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)); }