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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can I use the JDBC to Microsoft Access in Linux?

Status
Not open for further replies.

djiska

Programmer
Mar 5, 2003
3
ES
I run an application. This application is attempted to connect to a Access's file(this file is in Linux). But it gives me a exception "java.sql.SQLException:No suitable driver". I think that it can lack the driver. if it is so. can you tell me where can I to get?

The code is that:This run rightly in Windowss

import java.sql.*;
class Test
{
public static void main(String[] args)
{
try {
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
// set this to a MS Access DB you have on your machine
String filename = "/home/jaac/java/prueba/prueba.mdb";
String database = "jdbc:eek:dbc:Driver={Microsoft Access Driver (*.mdb)};DBQ=";
database+= filename.trim() + ";DriverID=22;READONLY=true}"; // add on to the end
// now we can get the connection from the DriverManager
Connection con = DriverManager.getConnection( database ,"","");
}
catch (Exception e) {
System.out.println("Error: " + e);
}
}
}

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top