help !!!

Light Poster
19Sep2004,07:45   #1
meena's Avatar
hi,

i want to use database - access in my java pgm.
first of all , i dunno wheter jdbc driver is installed in my sys
or not. how to check it. if not, how to install it.

then, vot r the lines of code in java in order to access my
database (ms-access).

plz, itz very urgent. plz mail me asap

bye,
meena
Go4Expert Founder
19Sep2004,09:20   #2
shabbir's Avatar
Quote:
first of all , i dunno wheter jdbc driver is installed in my sys or not. how to check it. if not, how to install it.
Try executing this code. If it runs successfully you have JDBC installed if not you need to get it for Access. Let me know if it runs.

Code:
  Query = "Some Valid SQL";
  Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
  String sourceURL = "jdbc:odbc:Dictionary";
  Connection databaseConnection = DriverManager.getConnection(sourceURL);
  Statement stmt = databaseConnection.createStatement();
  stmt.executeUpdate(Query);
Also you can see the Database drivers at
http://www.idssoftware.com/download.html#ODBC

Thanks
Shabbir Bhimani
Contributor
19Sep2004,13:54   #3
Amit Ray's Avatar
For most database systems, you can simply download a JDBC driver to connect to the Db with Java, but there aren't any free ones for Access. What you can do is create an ODBC datasource (with Windows), and use the JDBC-ODBC bridge to connect to that. I think the JDBC-ODBC bridge is included with the JDK package. Good luck!

You can create an access datasource in Win2k as follows: Start->Control panel->Administrative tools->Data Sources(ODBC)->MS Access Database->System DSN->Add->Select MS Access Database Driver ->Finish->Enter datasource name->Select Database->Click ok

Cheers,
Amit.
Light Poster
19Sep2004,21:51   #4
meena's Avatar
hi

thanx very much. itz workin. (the code)

bye
Contributor
19Sep2004,23:07   #5
Amit Ray's Avatar
gr8 ... just drop a line if you need further help ...

Cheers,
Amit Ray.
Go4Expert Founder
20Sep2004,07:36   #6
shabbir's Avatar
Quote:
thanx very much. itz workin. (the code)
Looks nice when something like this comes up

ALso if you need any further help just drop a query.

Thanks
Shabbir Bhimani