Click to See Complete Forum and Search --> : Need a source to learn Java/Access Database Application basics


Beat4600
February 24th, 2000, 03:13 PM
I want to start learning how to hook Java up to a database, such as MS-Access, but I'm having trouble finding a good source to simply explain this. Can anyone recommend a good book or on-line turorial. The sun site just leaves me more confused.

Jürgen
April 11th, 2000, 04:56 AM
You can start with the JDBC Database Access trail from Sun, which is located at http://java.sun.com/docs/books/tutorial/jdbc/basics/index.html

For making a connection to MS Access under NT:

You have to add the MS Access database in control panel -> odbc
user DSN -> add
select Microsoft Access Driver -> finish
fill in the fields...

Example Java Source (jdk1.2.2):

public void makeConnection() throws SQLException, ClassNotFoundException {
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
String url = ("jdbc:odbc:dbname");
//dbname is the name you gave to your database in your control panel
String username = ("");
String password = ("");
Connection con = DriverManager.getConnection(url,username,password);
}





"The views expressed herein are the personal views and opinions of the current user and are not made on behalf of his or her current employer."