Ayyaz Zafar
Ayyaz Zafar

Reputation: 2163

java.sql.SQLException: No suitable driver found for jdbc:derby://localhost:1527/Employees1

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

Screenshot of Services tab

Please guide me that why this error coming and how Can i fix this.

Waiting for Replies.

Thanks

Upvotes: 1

Views: 5400

Answers (1)

AllTooSir
AllTooSir

Reputation: 49352

Check for:

  1. derbyclient.jar is on the class path.

  2. Loading the driver class by

    Class.forName("org.apache.derby.jdbc.ClientDriver");
    

Upvotes: 4

Related Questions