I don't know what is type 4 JDBC, but as I know using JDBC to connect MS_Access is very easy and simple. Step 1: create or select a DSN for MS_Access Driver (through ODBC Data Source Administrator). Step 2: make connection in you java program, set String url = "jdbc dbc:yourDSN"; Step 3: in the try block, call Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); then you got the driver Step 4: in Connection try block: Connection conn = DriverManager.getConnection(url, userName, passWord); you can set userName and passWord to empty string " ", because Access does not require these. Step 5: create your Statement stmt = conn.createStatement().. then you're on the way.
From what i have read, JDBC DBC bridge to Access can only be accomplished with a type 1 driver.
Joined: Nov 17, 2000
And even that does not work. Even with ODBC connections to the database setup (SYSTEM, USER and FILE), all fail with Data Source not found and no default driver specified. I don't believe there is a way to connect to MS Access from Java.
Originally posted by Jeff Hancock: And even that does not work. Even with ODBC connections to the database setup (SYSTEM, USER and FILE), all fail with Data Source not found and no default driver specified. I don't believe there is a way to connect to MS Access from Java.
Jeff, You should pay attention to Gregg's tag line. Ignorance can usually be cured. That's one reason that we have forums. If you search the history for the JDBC forum you may find one or two entries that indicate that you actually can connect to MS Access from Java.
Please excuse the sarcastic overtones of my post...I can't seem to contain myself.
I am running on Windows-95 with JDK 1.3 connecting to an Access-97 db with no problems. Just follow the steps listed in the response by Ming Chen. I did not need to install any special driver. Hope this helps.