Reputation: 2163
I researched on this problem but i did not find solution.
Following is my Code:
package database_console;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
/**
*
* @author SuperPc
*/
public class DBConnect {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
try{
Connection con=DriverManager.getConnection("jdbc:derby://localhost:1527/Employees1","admin1","admin");
}
catch(SQLException err){
System.out.println(err);
}
}
}
When i run this Code then i get following
Error: java.sql.SQLException: No suitable driver found for jdbc:derby://localhost:1527/Employees1
Please guide me that why this error coming and how Can i fix this.
Waiting for Replies.
Thanks
Upvotes: 1
Views: 5400
Reputation: 49352
Check for:
derbyclient.jar is on the class path.
Loading the driver class by
Class.forName("org.apache.derby.jdbc.ClientDriver");
Upvotes: 4