Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

ODBC and Microsoft access

 
Jeff Dube
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
I need to work with a MSACCESS database and i need to connect to this database. Can i connect with JDBC using microsoft access?
I also searched and i often heard about creating a dsn before using odbc driver??? What is dsn?
Is it better to use jdbc or odbc (I am working with windows 2000)?
Thanks
Jeff
 
Daniel Dunleavy
Ranch Hand
Posts: 276
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes you can use MS ACCESS but you will need a driver for it.
Using ODBC is an interum solution. You can use the JDBC-ODBC bridge. Obviously you need to setup the data source(dsn) in ODBC before trying to connect to it. Basically you are giving it a name and what driver to use. In my case I just called it...MyDatabase and it uses a SQL Server driver. Then the connect uses the name MyDatabase to get to ODBC, and ODBC takes it from there.
Eventually you need to get a driver that supports your database because the JDBC-ODBC is not meant to be a production driver (just for development).
Dan
 
Alan Watts
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jeff,
To add to what Daniel said, in Win98 setting up your DSN (which is like a pointer to a DB file on your system) is relatively straightforward - you need to go to the Control Panel and then open up the ODBC Data Sources icon, and then follow the instructions (fairly simple for Access - perhaps not so simple for say SQLServer). I don't imagine setting up a DSN in Windows 2000 is terribly different.
As Daniel said, using the Sun JDBC:ODBC bridge is a fairly temporary measure - it is a type I JDBC driver, and as I understand it will not work over the internet. So, if you are publishing your Access DB on the web, you will need a commercial driver. I have tried Type III drivers from the following sources (type III drivers are also like the Sun JDBC:ODBC bridge but more sophisticated):
http://www.easysoft.com/ http://www.j-netdirect.com
Both of these work nicely with MS Access in my hands, but you can also view a more complete selection of drivers from the Sun site.
Cheers
Alan Watts
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic