How to connect a J2EE program to an Access Database
Joined: Jan 26, 2004
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?
My program, implements SessionBean, if that makes a difference? [ June 29, 2004: Message edited by: Bear Bibeault ]
Joined: Dec 09, 2003
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
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.