title: Cannot connect to Derby DB on netbeans using JDBC
body: <p>I am trying to manipulate an Apache Derby DB on NetBeans and I'm having a tough time connecting.</p>
  
  <p>It seems very simple but it just wouldn't connect.</p>
  
  <p>Please help. Thanks in advance!</p>
  
  <pre><code>import java.sql.*;
  
  public class JDBCtutorial {
      private static String tableName = "Diseases";
  
      private static Connection conn = null;
      private static Statement stmt = null;
  
      public static void createConnection() {
          try {
              Class.forName("org.apache.derby.jdbc.ClientDriver");
          } catch(ClassNotFoundException cnfe) {
              System.out.println(cnfe);
          }
          try {
              conn = DriverManager.getConnection("jdbc:derby://localhost:1527/DBName", "user", "password");
          } catch (Exception e) {
              System.out.println("Cannot connect. . .");
          }
      }
  
      public static void main(String[] args) {
          createConnection();
      }
  }
  </code></pre>