PearlJamFanatic
asked on
Connect and retrieve data from MS access from java
String myDB = "jdbc:odbc:Driver={Microsoft Access Driver (*.mdb)};DBQ=C:/CRDUtil/data/CRD1.MDB";
con = DriverManager.getConnection(myDB,"","");
rs = stmt.executeQuery(sqlStr); //throws nullpointerexception
the last line throws exception.
You need to specify data source in ODBC
you not creating a Statement
That's how I did connection to MS:
If you don't have user password just two empty lines should do like nothing between the quotes: "",""
-------------------------
Class.forName("sun.jdbc.od
Connection con1 = DriverManager.getConnectio
Statement stmt1 = con1.createStatement();
ResultSet rs1 = stmt1.executeQuery("select
--------------------------
ASKER
for_yan: how do i do that?
ASKER
I was following this. http://www.rgagnon.com/javadetails/java-0345.html
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Perhaps rgagnon eamples should also work, but I didn't try it taht way - I used ODBC, and it worked for me
ASKER