title: Error for loading driver for Java derby?
body: <p>I'm wondering why I can't do the simplest step in java database program! I have done this many times before and this time I'm doing seam routine but it doesn't work.</p>
  
  <p>I'm trying to create a database in embedded mode. I have located the derby.jar file in the seam directory. Here is the code and after that is the error:</p>
  
  <pre><code>public static void main(String[] args) throws SQLException {
  
       String driver ="org.apache.derby.jdbc.EmbeddedDriver";
       String url= "jdbc:derby:MyDatabase";
  
       try {
  
          Class.forName(driver).newInstance(); 
  
      } catch (InstantiationException e1) {
          e1.printStackTrace();
      } catch (IllegalAccessException e1) {
          e1.printStackTrace();
      } catch (ClassNotFoundException e1) {
          e1.printStackTrace();
      }
  
      Connection conn = DriverManager.getConnection(url+";create=true");   
  }
  </code></pre>
  
  <p>Here is the error:</p>
  
  <pre><code>java.lang.ClassNotFoundException: org.apache.derby.jdbc.EmbeddedDriver
      at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
      at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
      at java.lang.Class.forName0(Native Method)
      at java.lang.Class.forName(Class.java:169)
      at Data.main(Data.java:16)
  Exception in thread "main" java.sql.SQLException: No suitable driver found for jdbc:derby:MyDatabase;create=true
      at java.sql.DriverManager.getConnection(DriverManager.java:602)
      at java.sql.DriverManager.getConnection(DriverManager.java:207)
      at Data.main(Data.java:27)
  </code></pre>