Topic: 哪位高手能指点一下java如何连接access数据库?

  Print this page

1.哪位高手能指点一下java如何连接access数据库? Copy to clipboard
Posted by: mydata800
Posted on: 2005-09-15 11:29

小弟是菜鸟,请哥哥们讲一讲如何用java连接access数据库啊?

2.Re:哪位高手能指点一下java如何连接access数据库? [Re: mydata800] Copy to clipboard
Posted by: scriptlets
Posted on: 2005-09-15 11:38

try{
Class.forName(sun.jdbc.odbc.JdbcOdbcDriver);
}catch(java.lang.ClassNotFoundException e){
System.out.println("getConnection():"+e.getMessage()); }
try{
Connection con=DriverManager.getConnection(jdbc:odbc:ManageSystem);
Statement state=con.createStatement();
}catch(SQLException e){
System.err.println(e.getMessage());
}

3.Re:哪位高手能指点一下java如何连接access数据库? [Re: mydata800] Copy to clipboard
Posted by: glistar
Posted on: 2005-09-15 13:43

只能使用ODBC的方法了!

4.Re:哪位高手能指点一下java如何连接access数据库? [Re: mydata800] Copy to clipboard
Posted by: ruijie_zhao
Posted on: 2005-09-30 13:15

Connection con;
ResultSet rs;
Statement stmt;
lass.forName("sun.jdbc.odbc.JdbcOdbcDriver");
String strurl =
"jdbc:odbc:driver={Microsoft Access Driver (*.mdb)};DBQ=客户管理.mdb";
con = DriverManager.getConnection(strurl);
stmt=con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_READ_ONLY ) ;

rs=stmt.executeQuery("select * from friendInformation") ;


   Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent
Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1
客服电话 18559299278    客服信箱 714923@qq.com    客服QQ 714923