Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

connecting with access DB

Status
Not open for further replies.

GroundZero

Programmer
Feb 1, 2001
28
CA
hi everyone,

I am quite new at Java and I would like to know what I need and how to interact (read/write) with an access database

thank you in advance

regards

GroundZero Your soul is imperfect
Life is difficult...

Now guess why we're here
 
connecting to an access database is just like connecting to any other database, as long you have your DSNs in your ODBC.

then your have do the following in your code:
<----------->

Class.forName(&quot;sun.jdbc.odbc.JdbcOdbcDriver&quot;);

con = DriverManager.getConnection(&quot;Jdbc:Odbc:mytest&quot;);

Statement stmt = con.createStatement();

String query = &quot;SELECT * FROM LOGIN&quot;;
ResultSet rs = stmt.executeQuery(query);

<----------->

that will return your query
hope it helps.

 
connecting to an access database is just like connecting to any other database, as long you have your DSNs in your ODBC.

then your have do the following in your code:
<----------->

Class.forName(&quot;sun.jdbc.odbc.JdbcOdbcDriver&quot;);

con = DriverManager.getConnection(&quot;Jdbc:Odbc:mytest&quot;);

Statement stmt = con.createStatement();

String query = &quot;SELECT * FROM TABLE&quot;;
ResultSet rs = stmt.executeQuery(query);

<----------->

that will return your query
hope it helps.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top