"clowtown" wrote...
> I'm fairly new to database programming with java but
> I have used odbc to make connections to my database
> and do basic sql commands. However, I want to connect
> directly to the database and not use odbc. Do I need
> to download any drivers and what code would I need
> to make this connection. Thanks in advance
Unfortunately the best option AFAIK to connect to an Access Database, is
through the jdbc-odbc bridge.
However, that doesn't mean that you need to set up a DSN on your machine
beforehand. E.g. if you have an Access mdb-file "bar.mdb" in directory
"c:\foo":
DriverManager.registerDriver(new sun.jdbc.odbc.JdbcOdbcDriver());
String url = "jdbc:odbc:" +
"DRIVER={Microsoft Access Driver (*.mdb)};DBQ=c:\\foo\\bar.mdb";
Connection con
= DriverManager.getConnection(url);
There do exist some third-party drivers for Access, but mostly of type 3,
which means additional installation of a middle-ware application...
A possibly better option is to use another database than Access...
// Bjorn A
clowtown - 09 Mar 2005 13:52 GMT
thank you for the help and not for bashing my use of Access like others
have done. this is just a learning experience.
Tom Dyess - 11 Mar 2005 01:50 GMT
> thank you for the help and not for bashing my use of Access like others
> have done. this is just a learning experience.
Lol. I think almost every one of us used Access at one point or another in
our careers. It's a great learning tool for relational entities and
normalization if nothing else. Besides, we all started from not knowing
anything, that's just where you start!

Signature
Tom Dyess
OraclePower.com
Dan Nuttle - 11 Mar 2005 03:07 GMT
Access, like any other database, is a tool. You wouldn't use a hammer to
drive a huge wooden pile into a river bed; you wouldn't use a pile driver
to tap a tiny nail into your wall.
People who bash any given tool as being worthless for all situations don't
understand the nature of tools very well. Access can be a great learning
tool...it can also be a great database in the right situation. Like a
single-user desktop app, for instance. And there's nothing wrong with the
Jdbc-Odbc bridge...for the right purpose. For learning. Or for a small,
low-volume, non-mission-critical web app, like internal reporting.
> thank you for the help and not for bashing my use of Access like others
> have done. this is just a learning experience.