Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / First Aid / March 2005

Tip: Looking for answers? Try searching our database.

Using Access Database

Thread view: 
clowtown - 09 Mar 2005 06:04 GMT
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
Bjorn Abelli - 09 Mar 2005 06:43 GMT
"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.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.