1

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

Ayyaz Zafar
  • 2,015
  • 5
  • 26
  • 40

1 Answers1

4

Check for:

  1. derbyclient.jar is on the class path.

  2. Loading the driver class by

    Class.forName("org.apache.derby.jdbc.ClientDriver");
    
AllTooSir
  • 48,828
  • 16
  • 130
  • 164