当前位置: 代码迷 >> Eclipse >> java与access数据库,该如何解决
  详细解决方案

java与access数据库,该如何解决

热度:76   发布时间:2016-04-23 12:26:25.0
java与access数据库
java与access数据库连接的时候,需要设置数据源,在填写数据源名的时候,应该填写什么东西

------解决方案--------------------
Java code
     conn = getAccessConn("E:\\testData\\Test.mdb", "", "");   stmt = conn.createStatement();   rs = stmt.executeQuery("select * from UserInfo");   while (rs.next()) {   System.out.println(rs.getString(1) + "--" + rs.getString(2)   + " -- " + rs.getString(3));   }
------解决方案--------------------
Java code
   conn = getAccessConn("驱动名", "E:\\testData\\Test.mdb", "", "");   stmt = conn.createStatement();   rs = stmt.executeQuery("select * from UserInfo");   while (rs.next()) {   System.out.println(rs.getString(1) + "--" + rs.getString(2)   + " -- " + rs.getString(3));   }
  相关解决方案