title: H2 driver not found when try to connect
body: <p>I have gone through some other answers, but cannot get the solution to my problem.</p>
  
  <p>I am using NetBeans 7.0.1 and the latest version of the H2 DB on Win7.</p>
  
  <p>I successfully use the H2 console tool and I have also added the driver in NetBeans and am able to connect (i.e. see the DB, tables, issue commands, etc). However from within my Java code when running it, I get the message: "java.lang.ClassNotFoundException:org.h2.Driver".
  My code is:</p>
  
  <pre><code>Class.forName("org.h2.Driver");
  Connection conn = DriverManager.getConnection("jdbc:h2:tcp://localhost/~/testDB", "sa", "");
  Statement query = null;
  query = conn.createStatement();
  String firstString = "INSERT INTO ......";
  query.executeUpdate(firstString);
  </code></pre>
  
  <p>I have also added the H2 jar file in the classpath (although I had to create the classpath myself and point to the jar file) - I went to environment variables -> user variables  </p>
  
  <pre><code>name=classpath value=.;C:\NetBeansProjects\testdemo\src\testdemo\DB\h2-1.3.165.jar
  </code></pre>
  
  <p>What am I doing wrong? </p>