The Artima Developer Community
Sponsored Link

Legacy Java Answers Forum
June 2000

Advertisement

Advertisement
where you can ask and answer Java programming questions.">
artima.com - a resource for Java and Jini developers
Artima | Search | Java | Design | JVM | Jini | Books | Seminars | Subscribe 


Java Answers Forum
June 2000

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:

insert values to a table in access 2000 from java?

Posted by Tassos on March 27, 2001 at 12:15 PM

> > 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