Hi everyone! I have a classpath problem where I have a database called wrox4370.db(located in c:\wrox\database\Wrox4370.db) that I'm trying to access with the MakingTheConnection class(located in the same directory). import java.sql.*; public class MakingTheConnection { public static void main(String[] args) { // Load the driver try { // Load the driver class Class.forName("COM.cloudscape.core.JDBCDriver"); // Define the data source for the driver String sourceURL = "jdbc:cloudscape:Wrox4370.db";
// Create a connection through the DriverManager Connection databaseConnection = DriverManager.getConnection(sourceURL); // We made it! System.out.println("Connection established successfully!"); // close connection databaseConnection.close(); } catch (ClassNotFoundException cnfe) { System.err.println(cnfe); } catch (SQLException sqle) { System.err.println(sqle); } } } I have compiled the class successfully but am at a loss as to how to run it using java -cp and/or java -classpath. I usually get an SQLException."Wrox4370.db" not found. My understanding of classpath is fuzzy .Does anyone have any insight into this problem?
You should run java with the switch -classpath c:\wrox\database;OTHER_JAVA_STUFF have you tried without the extension ".db" ? I mean like this: String sourceURL = "jdbc:cloudscape:Wrox4370"; ------------------ Valentin Crettaz Sun Certified Programmer for Java 2 Platform [This message has been edited by Valentin Crettaz (edited November 16, 2001).]