aspose file tools*
The moose likes JDBC and the fly likes Driver for MSAccess Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Driver for MSAccess" Watch "Driver for MSAccess" New topic
Author

Driver for MSAccess

campos teixeira
Ranch Hand

Joined: May 23, 2004
Posts: 51
Iam looking for a driver to access a database in Access I alredy have the code but This is not compiling:

Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");

I am getting an error saying that Unhandled Exception type ClassNotFoundException

and when I use the import sun.jdbc.odbc.JdbcOdbcDriver;
says that the import sun.jdbc.odbc.JdbcOdbcDriver; is never used.

So I guess is that It cant find the driver! I am using eclipse and I tried to import the sun.jdbc.odbc.JdbcOdbcDriver but I cant find it. I know I have to import the jar files in the eclipse and tomcat and it is ok to do with SQL Server but no luck with MSaccess.

Also I know that it JDBC-ODBC driver comes with the jdk but where?? or which jar file I have to import??

Can you anyone point me where I can get or How??

Thanks
Chris Mathews
Ranch Hand

Joined: Jul 18, 2001
Posts: 2712
Originally posted by campos teixeira:
I am getting an error saying that Unhandled Exception type ClassNotFoundException

This is a basic Java compilation error. It doesn't mean that the class can't be found, it means that you aren't handling the exception properly.

A proper example would look something like:
campos teixeira
Ranch Hand

Joined: May 23, 2004
Posts: 51
thanks I did the catch for the exception and manage to connect to the database I think because I havent got a password for the database which is in MSAcess.

But Now I found out that MS Acess dont alow transactions because I tried to select a column from the java Apllication and nothing?



Anyone knows how??
Thanks
Chris Mathews
Ranch Hand

Joined: Jul 18, 2001
Posts: 2712
Sorry, you are out of luck here. MS Access is a desktop database which means it doesn't have the robust features like transactioning. For learning purposes this is absolutely fine. However, MS Access should never be used to back a production application that is meant to scale beyond a handful or users.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Driver for MSAccess