• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to connect a J2EE program to an Access Database

 
King-Chieh Wang
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34396
346
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"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
 
Douglas Rowe
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My apologies barkeep.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34396
346
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Douglas,
No problem. Thanks for changing it.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic