Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JDBC Driver error

 
Srivatsan Sampath
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hai,
I installed J2EE, JDK1.3, set the path for J2EE_PATH to point to the j2ee bin directory, JAVA_HOME to point to the directory where JDK1.3.1 is installed and also set the ANT_HOME. According to the J2EE documentation I need not set anything in default.properties to access the cloudscape database.
I wrote this piece of code and I get a ClassNotFoundException : COM.cloudscape.core.JDBCDriver.
import java.awt.event.*;
import java.util.*;
import java.sql.*;

public class HelloJdbc extends Object{
private Connection connection;

public HelloJdbc()
{
String url = "jdbc:cloudscape rojects;create=true";
String Username = "";
String Password = "";
try{
Class.forName("COM.cloudscape.core.JDBCDriver").newInstance();
}
catch( Exception E)
{
System.err.println("Unable to load driver.");
E.printStackTrace();
}

try {
Connection c = DriverManager.getConnection(
url, Username, Password);
}
catch(SQLException sqlex) {
System.err.println(" SQL Error");
sqlex.printStackTrace();
System.exit(1);
}
}
public static void main(String[] args)
{
HelloJdbc HJ = new HelloJdbc();
}
}
Any suggestions.
Thanks
Sri
 
Daniel Dunleavy
Ranch Hand
Posts: 276
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would think it can't find the driver
Maybe try this
java -Djdbc.drivers=COM.cloudscape.core.JDBCDriver
applicationClass
also look at here
Dan
[This message has been edited by Daniel Dunleavy (edited June 28, 2001).]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic