jQuery in Action, 3rd edition
The moose likes JDBC and Relational Databases and the fly likes Can't connect to Access database using Cloudscape Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "Can Watch "Can New topic

Can't connect to Access database using Cloudscape

Jodie Anderson

Joined: Feb 08, 2002
Posts: 2
I have the following code:
import java.sql.*;
public class Exercise2_1 {
static String driver = "COM.cloudscape.core.JDBCDriver";
static String url = "jdbc:cloudscape:c:/j2sdkee1.3/cloudscape/test2";
public static void main(String[] args) {
System.out.println("Loaded driver");
Connection conn = DriverManager.getConnection(url);
System.out.println("Connected to database");
System.out.println("Closed connection");
catch(Throwable e)
The driver loads fine.
However, I get an error message saying "Can't find database" (the Access
database does exist in the given directory above!)
Is the fact that it is an Access db an issue? If so, how can I resolve this
Any info would be great, as I am at a loss here!
Thanks in advance!
Sean Richards

Joined: Feb 02, 2002
Posts: 8
In order to connect to an Access database you must first set up the DSN in ODBC. Then you must use the appropriate driver for Access. You cannot connect to an access database using a cloudscape driver. the right driver to use is
String driver = "Sun.jdbc.odbc.JdbcOdbcDriver"
String url = "jdbc dbc SNNAME"
The DSNNAME is the name you choose to use for your database.
Hope this helps.
I agree. Here's the link: http://aspose.com/file-tools
subject: Can't connect to Access database using Cloudscape
jQuery in Action, 3rd edition