Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Driver for MSAccess

 
campos teixeira
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2712
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2712
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic