The Artima Developer Community
Sponsored Link

Legacy Java Answers Forum
June 2000

Advertisement

Advertisement

This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.

Message:

java.sql.DatabaseMetaData.getTables()

Posted by Phillip Wray on September 06, 2001 at 4:29 PM

Are there any vendors that ship an odbc driver for MS ACCESS in which the driver implements the java.sql.DatabaseMetaData.getTables() method??? The basic sun.jdbc.odbc.JdbcOdbcDriver does not do this.


> > Hi,
> >
> > If you decided to use the MS Access with JAVA , you should've to create the DSN in all the client's machine what are all supposed to use that application.

> > YOu can use the following code to connect to databse using Access in JAVA.

> > Regards,
> > Rajesh

> > //////////////////// CODE STARTS HERE ////////////

> > public class DataBase
> > {
> > static String url = "jdbc:odbc:test" ; // test is the DSN
> > static String message;
> > static String query=null;
> > ResultSet rs;
> > Connection connection;

> >
> > public DataBase(){
> > try{

> > Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
> > System.out.println("contacted");
> > connection = DriverManager.getConnection(url);
> > System.out.println("Connection established");
> > }catch(Exception ex)
> > {
> > message = "Exception during SQL query: " + ex.toString();
> > ex.printStackTrace(System.out);
> > }

> > }

> >
> > ////////////// CODE ENDS HERE////////////////
> Hi,

> I want learn how to use Java for MS Access. Please suggest me any materials or web sites. Is there any material so that I can learn JDBC-ODBC concepts for Java? Please reply me

> Thanks and Regards,

> Sanjeev V.C

> > After this just create the instance of this class and call the method.

> > Regards,

> > Rajesh





Replies:

Sponsored Links



Google
  Web Artima.com   
Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us