• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Ganesh Patekar

connectivity between java and ms access

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello
Can any one please tell me how can i connect jdk1.3 to ms acces as back end
thanks in advance
 
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your question is one that many people have asked. You are not alone. Try doing a search in this forum on "bridge" or "Access" and you will certainly find what you are looking for.
 
dhirajsrivastava
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all
can any one please give me the code for connectivity b/w java and ms access
and please specify the driver for this purpose
thanks
dhiraj
 
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I will send u the program tomorrow.
regards,
kichu.
 
kichu kichu
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hai,
Sorry for the delay.Here is what u want.I have given below the getconnection java file.
dsn stands for Data Source Name.(Specify your dsn here).
package packagename;
import java.sql.*;
public class getconnection
{
public Connection getconnection(String dsn)
{
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
String url="jdbc dbc:"+dsn;
Connection con=DriverManager.getConnection(url);
return con;
}
catch(ClassNotFoundException e)
{
System.out.println("class not found....");
return null;
}
catch(SQLException se)
{
System.out.println("unable to connect");
return null;
}
}
}

When u call this file from the jsp page,do the following.The code below has to be given in the jsp page.
*****************************************************************
getconnection gc=new getconnection();
Connection con=gc.getconnection(dsn);
*****************************************************************
This will pass dsn(Your data source name) to the java file.
regards,
kichu.
once again ,sorry for the delay!!!
[This message has been edited by kichu kichu (edited May 20, 2001).]
 
Won't you please? Please won't you be my neighbor? - Fred Rogers. Tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!