Menu
I answered a similar question a while back. Basically at that time:. You could connect to Ms-Access from 32 bit java through the JDBC-ODBC bridge. You could not connect to a 32 bit Odbc driver through the JDBC-ODBC from 64 bit java.
There was a message telling you that you can only connect from a 32 bit programs. While Microsoft does provide a 64 bit Ms-Access driver, it did not work with Java's 64 bit JDBC-ODBC driver. Since then there seems to be a new open-source Ms-Access JDBC Driver. I have no Idea how good it is.
JDBC-ODBC MS-ACCESS CONNECTION STOPPED WORKING IN JDK8. I solved the issue by installing JDK7 along with JDK8 in the same PC, once installed JDK7 I assigned it as the JDK version to use in my project as follows in Netbeans: 1.RIGHT CLICK THE PROJECT IN THE LIST CLICK PROPERTIES 2.CLICK LIBRARIES ON THE LEFT NAVIGATION TREE 3.CLICK BUTTON MANAGE PLATFORMS CLICK BUTTON ADD PLATFORM. 4.FOLLOW WIZARD, DESPITE IT SHOWS JAVA STANDARD EDITION CLICK NEXT 5.NAVIGATE TO C: Program Files (x86) Java AND SELECT THE FOLDER OF JDK7 CLICK NEXT 6.THE FIELD AUTOFILL WITH THE RIGHT INFO. THEN CLICK FINISH 7.SELECT THE JDK PLATFORM FROM THE LIST CLICK CLOSE OK 8.JDK7 SHOULD SHOW IN LIBRARIES PACKAGE. Click Back in Browser to return here after looking at the image. From here on everything must run smoothly. Hope it solves your problem.
![Ms access jdbc connection Ms access jdbc connection](https://www.easysoft.com/images/applications/microsoft-access/odbc-microsoft-access-setup-dialog-box.gif)
While Microsoft does provide a 64 bit Ms-Access driver, it did not work with Java's 64 bit JDBC-ODBC driver. Since then there seems to be a new open-source Ms-Access JDBC Driver Ms-Access JDBC driver. I have no Idea how good it is.
Originally posted by Zein Nunna: Thanks for your reply Naseem, but I mentioned I'm using Tomcat, but forgot to state I am also using JNDI etc. Hence for I need a.jar file that I put in the.common/lib folder.
![Jdbc Driver For Access Jdbc Driver For Access](http://www.linglom.com/images/Windows/Programming/NetBeans-MSAccess2007/Part-2/5.png)
MySQL and other DB's have drivers, I assumed that MS Access would also have one?? Am on the right lines guys?
Thanks Zein Most people use the JDBC-ODBC bridge, which is built into; no seperate driver required. There are some commercial drivers for MS Access out there; I've never used one and don't know any particular names. Hey guys thanks for your responses so far, Stu - jdbc-odbc is used when your not using JNDI - hence cant use it now that I am wanting to use JNDI Naseem - I have followed the Tomcat instructions for configurig JNDI, so changed the web.xml and server.xml accordingly adding the context tag, then resource etc. still no luck though. I have a funny feeling that MS Access is not JNDI compatible - I came across this in another javaranch: If there is anybody out there who has got this combination working MS Access + Tomcat + JNDI, let me know please. Thanks Oh btw I'm using Tomcat 5.5 Regards. Ok guys here's what I have done, I still get an error when I call the HTTP Status 500 - type Exception report message description The server encountered an internal error that prevented it from fulfilling this request.
Exception java.lang.NullPointerException HelloServlet.doGet(HelloServlet.java:103) I registerd my DB via control panel and the add to systemDSN (this points to the DB on my Tomcat). Naseem, Sorry for the late reply I was away for the weekend Ok the exact Tomcat is 5.5.17, Now that I've chnaged the DSN from system to user, I get less errors, the error I do get is as follows: javax.naming.NameNotFoundException: Name jdbc is not bound in this Context at org.apache.naming.SelectorContext.lookup(SelectorContext.java:136) at javax.naming.InitialContext.lookup(Unknown Source) Does this make sense to anyone? Seems like I've not done something, where the context needs to be set? Thanks in advance, regards Zein.
Hey Naseem/ everybody else, In the previous post I noticed a inconsistency, (it might not be!) db1 = the DSN name, resource name = TestDB In your servlet-code you refer to TestDB?? If you look at one of your above posts, the name of the resource and DSN name were the same? - I still have the problem above outstanding, I'm temporarily using classforname.etc. I still howevere want to solve this JNDI problem. So just to go through this step by step url= 'jdbc:odbc:db1' My MS Access database is on my desktop and is added via DSN- system, called db1 - real file name is testMyDb.mdb DSN - system, works for classforname. The servlet code is as follow try dataSource = (DataSource) envContext.lookup('jdbc/db1'); conn = dataSource.getConnection; stmt. It all seems ok to me?
Why am I then having a problem? Error is something along the lines of JDBC is not bound in the context. Ive been reading the web and people advice to create a file called context.xml is that necessary? Is this an environmental problem or a coding problem? I call all my servlets directly by enabling the invoker servlet via conf/web.xml Thanks in advance for your advice/views Regards Zein added line breaks so page doesn't wrap July 06, 2006: Message edited by: Jeanne Boyarsky.