You must catch an Exception that *might* be thrown, in this case it's
ClassNotFoundException.
Change:
public static void main(String[] args)
{
Class.forName("org.postgresql.Driver");
}
to
public static void main(String[] args)
{
try {
Class.forName("org.postgresql.Driver");
} catch (ClassNotFoundException e ){
}
}
This way it'll compile. This has nothing to do with JDBC, this is
basic Java stuff.