aspose file tools*
The moose likes JDBC and the fly likes connectivity between java and ms access Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "connectivity between java and ms access" Watch "connectivity between java and ms access" New topic
Author

connectivity between java and ms access

dhirajsrivastava
Greenhorn

Joined: May 12, 2001
Posts: 9
Hello
Can any one please tell me how can i connect jdk1.3 to ms acces as back end
thanks in advance
Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
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

Joined: May 12, 2001
Posts: 9
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
kichu kichu
Ranch Hand

Joined: May 10, 2001
Posts: 59
I will send u the program tomorrow.
regards,
kichu.
kichu kichu
Ranch Hand

Joined: May 10, 2001
Posts: 59
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).]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: connectivity between java and ms access