title: Connecting to Netbeans SQL Database for the first time - java.sql.SQLException: No suitable driver found 0 08001
body: <p>I am fairly new to Java, so I bought a book to learn from.  Everything went swimmingly until I got to the chapter on SQL.  I am working in NetBeans with the sample database, but I can't get the database to connect with  the program.</p>
  
  <p>Here's the code I faithfully copied from the book:</p>
  
  <pre><code>import java.sql.*;
  
  public class SysTableReporter {
      public static void main(String[] arguments) {
          String data = "jdbc:derby://localhost:1527/sample";
          try (
              Connection conn = DriverManager.getConnection(
                      data, "app", "APP");
              Statement st = conn.createStatement()) {
                  System.out.println("TABLEID:\t" );
  
              Class.forName("org.apache.derby.jdbc.ClientDriver");
  
              ResultSet rec = st.executeQuery(
                      "select * " + 
                      "from SYS.SYSTABLES " + 
                      "order by TABLENAME");
              while(rec.next()) {
                  System.out.println("TABLEID:\t" + rec.getString(1));
                  System.out.println("TABLENAME:\t" + rec.getString(2));
                  System.out.println("TABLETYPE:\t" + rec.getString(3));
                  System.out.println("SCHEMAID:\t" + rec.getString(4));
                  System.out.println();
              }
              st.close();
          } catch (SQLException s) {
              System.out.println("SQL Error: " + s.toString() + " " 
                      + s.getErrorCode() + " " + s.getSQLState());
          } catch (Exception e) {
              System.out.println("Error: " + e.toString() + e.getMessage());
          }
      }
  }
  </code></pre>
  
  <p>Here's what my Services Panel looks like:</p>
  
  <p><a href="http://u.jimdo.com/www66/o/sc4002b6e39b69de8/img/i0d45e76e18e2f2ca/1386786683/std/image.png" rel="nofollow">Click to view Image</a></p>
  
  <p>Here's my output:</p>
  
  <pre><code>SQL Error: java.sql.SQLException: No suitable driver found for jdbc:derby://localhost:1527/sample 0 08001
  </code></pre>
  
  <p>At first I figured I just had some typo, but looking over it carefully I can't find it.  I tried installing a new JDBC driver, but that didn't seem to help either.  I'm running a Windows 8 laptop, and I have the telnet client turned on.  My best guess at this point is that I somehow missed a step in the initial setup, but I can't find it to go back and fix it.  Any help would be great.</p>