wood burning stoves 2.0*
The moose likes JDBC and the fly likes How to connect a J2EE program to an Access Database Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "How to connect a J2EE program to an Access Database" Watch "How to connect a J2EE program to an Access Database" New topic
Author

How to connect a J2EE program to an Access Database

King-Chieh Wang
Greenhorn

Joined: Jan 26, 2004
Posts: 24
As stated in the title, where can I find some resource or if there is anyone can shed some light on what codes I should use to connect a J2EE Program to an Access Database?

Thanks,

King-Chieh

My program, implements SessionBean, if that makes a difference?
[ June 29, 2004: Message edited by: Bear Bibeault ]
Douglas Rowe
Greenhorn

Joined: Dec 09, 2003
Posts: 10
Not sure if you are asking for the connection strings or the form for JDBC, so I'll give you both in this little snippet. You need to first create an ODBC driver using MS' ODBC manager. Go to the control panel, and depending on the version of Windows you are on, you will either see an Icon that says Data Sources (ODBC) or you will see Administrative Tools. If the latter, ODBC is in the next level. Open up the manager and select the System DSN tab. Click add to add a new driver. You will need to select Microsoft Access Driver as the type, give it a name (for the example we'll use myDriver) and point it the Access database you want it to work with. Save it and you're ready.

Basic JDBC code will look like this:


[ July 01, 2004: Message edited by: Hoss ]

Whenever you find yourself on the side of the majority, it is time to pause and reflect. Mark Twain
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30123
    
150

"Hoss",

We're pleased to have you here with us in the JDBC forum, but there are a few rules that need to be followed, and one is that proper names are required. Please take a look at the JavaRanch Naming Policy and adjust your display name to match it.

In particular, your display name must be a first and a last name separated by a space character, and must not be obviously fictitious.

Thanks,
Jeanne
Forum Bartender


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Douglas Rowe
Greenhorn

Joined: Dec 09, 2003
Posts: 10
My apologies barkeep.
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30123
    
150

Douglas,
No problem. Thanks for changing it.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to connect a J2EE program to an Access Database
 
Similar Threads
how can java connect to Access?
Applet and DataBase Connectivity
MS-Access with Weblogic
need a sample code JDBC ..preparedstatement
how to connect to database in FORTE ---"3.0"---