title: Trying to use jdbc driver for postgresql but it's not working
body: <p>I have added the jdbc driver to my classpath as far as I know i.e. I added the following to my .profile</p>
  
  <p>export CLASSPATH=$CLASSPATH:location/to/the/jarfile.jar</p>
  
  <p>When I compile my java program I always get this error</p>
  
  <pre><code>javac v9.java
  v9.java:8: &lt;identifier&gt; expected
   Class.forName("org.postgresql.Driver");//load the driver
            ^
  v9.java:8: illegal start of type
   Class.forName("org.postgresql.Driver");//load the driver
             ^
  2 errors
  </code></pre>
  
  <p>This is driving me insane, any help would be awesome. I'm using Mac OS X Snow Leopard</p>
  
  <p>The java program is here</p>
  
  <pre><code>import java.sql.*;
  
  public class v9
  {
   String dbURL = "jdbc:postgresql:mydb";
   String user = "UserName";
   String password = "pswd";
   C  try
  {
  Class.forName("org.postgresql.Driver");//load the driver
  // Connect to the database
  Connection DBconn = DriverManager.getConnection( dbURL, user, password );
  }
  catch (Exception e)
  {
      e.printStackTrace();
  }
  }
  </code></pre>