Problem Connecting Java application to MS Access Database

Would like to connect my MS Access Database tables to my Java Application. Initially I want to simply display a field value from an Access database table on the screen.

(Say -

database file name: school.mdb

table name: student_details

field name: First Name, Last Name, Roll No, City)

I'm very new to Java and using the Really Big Index Tutorial online to learn java skills. (http://java.sun.com/docs/books/tutorial/reallybigindex.html). This does not throw much light on the basics, and says how Netbeans app can be connected to Derby sample database... which is not clear to me as well.

Please guide accordingly.

[668 byte] By [NishantJain1a] at [2007-11-27 9:45:02]
# 1

Hello...

For JDBC, you have to import java.sql.*.

Then Create a DSN ( from Administrative tools ) for your database.

try

{

Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");

con = DriverManager.getConnection("jdbc:o dbc:DSNNAme","Usename","Password");

}catch(Exception e)

{

}

Before posting such simple questions... try to search on google there are many examples. try JDBC + ODBC.

// Anupam Pawar

PremInda at 2007-7-12 23:52:59 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...