PDA

View Full Version : No suitable driver found for jdbc



Mitch1234
06-15-2009, 07:01 PM
Error I am getting.

1) Do I need to replace www.novajobseeker.com with an IP?

2) Where is this driver not found on server www.novajobseeker.com?

3) What are the steps to resolve this?

No suitable driver found for jdbc:mysql://www.novajobseeker.com/novajobs_customer
java.sql.SQLException: No suitable driver found for jdbc:mysql://www.novajobseeker.com/novajobs_customer
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at customerData.JDBCDemo.main(JDBCDemo.java:11)




package customerData;

import java.sql.*;

public class JDBCDemo {
public static void main( String[] args ) {
try {
// Connect to the database
//Class.forName("com.mysql.TheirJdbcDriver").newInstance();
String url = "jdbc:mysql://www.novajobseeker.com/novajobs_customer";
Connection con = DriverManager.getConnection(url, "novajobs_user", "xxxxxx");
// Execute the SQL statement
Statement stmt = con.createStatement();
ResultSet resultSet = stmt.executeQuery("SELECT * from CustomerInfo");
System.out.println("Got results!");
// Loop thru all the rows
while( resultSet.next() ) {
//String data = resultSet.getString( "CompanyName" );
System.out.println( resultSet ); //(data);
}
stmt.close();
}
catch( Exception e ) {
System.out.println(e.getMessage());
e.printStackTrace();
}
}
}

Mitch1234
06-16-2009, 12:10 AM
I figured out this error I was missing a Jar file with necessary jdbc information.