国产一级a片免费看高清,亚洲熟女中文字幕在线视频,黄三级高清在线播放,免费黄色视频在线看

打開(kāi)APP
userphoto
未登錄

開(kāi)通VIP,暢享免費(fèi)電子書(shū)等14項(xiàng)超值服

開(kāi)通VIP
jsp連接ACCESS
一.建立數(shù)據(jù)庫(kù)
 ?。?建立jcc.mdb數(shù)據(jù)庫(kù)及user表
 ?。?添加測(cè)試數(shù)據(jù)
二.在<%wwwroot%>/下,新建Access數(shù)據(jù)庫(kù)連接文件Select.jsp

  Select.jsp源碼如下:

<%@page contentType="text/html;charset=gb2312"%>
<%@page import="java.sql.*"%>
<html>
<body>
<%
try{
  Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
}
catch(ClassNotFoundException e){
  out.print(e);
}
try{
  String strDirPath=application.getRealPath(request.getRequestURI());
  strDirPath=strDirPath.substring(0,strDirPath.lastIndexOf('\\'))+"\\";
  String url = "jdbc:odbc:driver={Microsoft Access Driver (*.mdb)};DBQ="+strDirPath+"jcc.mdb";
  Connection conn = DriverManager.getConnection(url);
  Statement stmt = conn.createStatement();
  ResultSet rs = stmt.executeQuery("SELECT * FROM user");
  out.println("User-list"+"<br>");
  while(rs.next()){
    out.print(rs.getString(1)+" ");
    out.print(rs.getString(2)+"<br>");
  }
  rs.close();
  stmt.close();
  conn.close();
}
catch(Exception ex){
  out.print(ex);
}
%>
</body>
</html>
本站僅提供存儲(chǔ)服務(wù),所有內(nèi)容均由用戶發(fā)布,如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請(qǐng)點(diǎn)擊舉報(bào)。
打開(kāi)APP,閱讀全文并永久保存 查看更多類似文章
猜你喜歡
類似文章
jsp 連接access數(shù)據(jù)庫(kù)實(shí)例
jsp連接MySQL數(shù)據(jù)庫(kù)
access驅(qū)動(dòng)
Jsp中調(diào)用Oracle存儲(chǔ)過(guò)程的小例子
JAVA連接Access數(shù)據(jù)庫(kù)
Java如何連接Access數(shù)據(jù)庫(kù)(兩種方式實(shí)例代碼)
更多類似文章 >>
生活服務(wù)
分享 收藏 導(dǎo)長(zhǎng)圖 關(guān)注 下載文章
綁定賬號(hào)成功
后續(xù)可登錄賬號(hào)暢享VIP特權(quán)!
如果VIP功能使用有故障,
可點(diǎn)擊這里聯(lián)系客服!

聯(lián)系客服