This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes JDBC and the fly likes Class connection not found Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Class connection not found" Watch "Class connection not found" New topic
Author

Class connection not found

L. Riley
Greenhorn

Joined: Mar 20, 2001
Posts: 28
I am trying to display records from a Cloudscape database. When my page tries to display I get an error message that ends with 61: Class connection not found.
I have checked my classpath and I am not sure where to look from here...
Will someone give me a hint what might be wrong here?
Thank you.
Lee Wallen
Greenhorn

Joined: Jul 14, 2001
Posts: 10
make sure that you import java.sql.* or java.sql.Connection.
import java.sql.*;
public class TestConn {
public static void main (String args []) {
try {
String dbUrl = args[0];
String driverName = args[1];

Class.forName(driverName).newInstance();
Connection con =
DriverManager.getConnection(dbUrl, "", "");
System.out.println("conn.isClosed = " + conn.isClosed());
} catch (Exception e) {
e.printStackTrace();
}
}
}
[This message has been edited by Lee Wallen (edited July 15, 2001).]
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Class connection not found