New to JDBC

hello;am trying to make an application which is need database with java,,my data base is built by Access but can any when help how to start with java?
[164 byte] By [student14a] at [2007-11-26 17:49:28]
# 1
http://java.sun.com/docs/books/tutorial/jdbc/%
duffymoa at 2007-7-9 5:01:55 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 2

hi,

You will require the below line to connect to access database

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

con=DriverManager.getConnection("jdbc:odbc:DRIVER={Microsoft Access Driver (*.mdb)};DBQ=test.mdb;","dba","sql");

//Be careful while using this line. You should copy it exactly

Remaining all you can learn from the tutorials.

Ashitosha at 2007-7-9 5:01:56 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 3

thanx for your reply;

but i wrote what u told me,,but theses errors results:

C:\database.java:6: <identifier> expected

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

^

C:\database.java:7: <identifier> expected

con=DriverManager.getConnection

^

2 errors

student14a at 2007-7-9 5:01:56 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 4

i found out my mistake,,i have to put theses statemant into method..

i didi that and i have Process complete

without any error.

but when i run the application the following exception is resulted;

JAVA.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver]

and some other unknown sympols

student14a at 2007-7-9 5:01:56 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 5
write the code in a try and catch block as it throws Exception which should be catched
Ashitosha at 2007-7-9 5:01:56 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...