title: java.sql.SQLException: No suitable driver found for jdbc:derby:
body: <p>I'm a beginner with jdbc ...  I have a problem running this code :</p>
  
  <p>This code uses appache derby and in order to make it work I first  started the derby server.. </p>
  
  <pre><code>      java -jar "C:\Program Files\Sun\JavaDB\lib\derbyrun.jar" server start
  </code></pre>
  
  <p>And then started the  program</p>
  
  <pre><code>      java -classpath derbyclient.jar -jar TestDB.jar
  </code></pre>
  
  <p>I set the class path 
            C:\Program Files\Sun\JavaDB\lib\derby.jar</p>
  
  <p>And I'm always getting that exception</p>
  
  <p><strong>java.sql.SQLException: No suitable driver found for jdbc:derby://localhost:1527/
  BOOKDB;create=true
          at java.sql.DriverManager.getConnection(DriverManager.java:602)
          at java.sql.DriverManager.getConnection(DriverManager.java:185)
          at TestDB.getConnection(TestDB.java:63)
          at TestDB.runTest(TestDB.java:20)
          at TestDB.main(TestDB.java:11)</strong></p>
  
  <pre><code>import java.sql.*;
  import java.io.*;
  import java.util.*;
  
  
  class TestDB
  {
     public static void main(String args[])
     {
        try
        {
           runTest();
        }
        catch (SQLException ex)
        {
           for (Throwable t : ex)
              t.printStackTrace();
        }
        catch (IOException ex)
        {
           ex.printStackTrace();
        }
     }
  
     public static void runTest() throws SQLException, IOException
     {
        Connection conn = getConnection();
        try
        {
           Statement stat = conn.createStatement();
  
           stat.executeUpdate("CREATE TABLE Greetings (Message CHAR(20))");
           stat.executeUpdate("INSERT INTO Greetings VALUES ('Hello, World!')");
  
           ResultSet result = stat.executeQuery("SELECT * FROM Greetings");
           if (result.next())
              System.out.println(result.getString(1));
           result.close();
           stat.executeUpdate("DROP TABLE Greetings");
        }
        finally
        {
           conn.close();
        }
     }
  
     public static Connection getConnection() throws SQLException, IOException
     {
        Properties props = new Properties();
        FileInputStream in = new FileInputStream("database.properties");
        props.load(in);
        in.close();
  
        String drivers = props.getProperty("jdbc.drivers");
        if (drivers != null) System.setProperty("jdbc.drivers", drivers);
        String url = props.getProperty("jdbc.url");
        String username = props.getProperty("jdbc.username");
        String password = props.getProperty("jdbc.password");
  
        return DriverManager.getConnection(url, username, password);
     }
  }
  </code></pre>