It's not a secret anymore!*
The moose likes JDBC 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

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC
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.
wood burning stoves
subject: Can't connect to Access database using Cloudscape
Similar Threads
Database program major issues.
Establishing Connection to MS Access Databases
how to connect MS Access directly
Is my javaBean a javaBean?
Remote Exception in EJB with MySQL