This week's giveaway is in the Spring forum.
We're giving away four copies of REST with Spring (video course) and have Eugen Paraschiv on-line!
See this thread for details.
The moose likes JDBC and Relational Databases and the fly likes jdbc -access Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "jdbc -access" Watch "jdbc -access" New topic

jdbc -access

Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
I'm using access as database.when we use SQL as database we write import java.sql.*;
but when we use access what are the library functions which we have to import?Can anyone provide me with the code to access Access database.
John Bateman
Ranch Hand

Joined: Mar 09, 2000
Posts: 320
The code is the same, you just may need another driver. Like the JDBC/ODBC bridge driver.
Hope this helps.

SOURCE CODE should be SURROUNDED by "code" tags.
David O'Meara

Joined: Mar 06, 2001
Posts: 13459

I'm assuming you're running on a windows machine, first you have to set up your access file to use the odbc drivers (cos access is a file, not an RDBMS)
Go to the control panel, odbc data sources, user dsn tab, add, select *.mdb, finish.
Give the file a name, in the database section browse and select your database.
Once you've done this you should be able to go...

David O'Meara

Joined: Mar 06, 2001
Posts: 13459

I promised myslef I'd never forget to turn smilies off when writing jdbcdbc.
Looks like I failed.

Don't get me started about those stupid light bulbs.
subject: jdbc -access
It's not a secret anymore!