I try to run the following program for an hour using the postgresql class
class Test{
public static void main(String[] args){
try {
Class.forName("org.postgresql.Driver");
} catch (ClassNotFoundException cnfe) {
System.err.println("Couldn't find Postgresql driver class!");
}
}
}
The program was compiled using the javac command, but it is not easy for me to run it using the postgresql path. I have "postgresql-9.0-801.jdbc4.jar" in the same directory as the file, and I tried the following but didn't work
java -classpath ./postgresql-9.0-801.jdbc4.jar Test
java -classpath postgresql-9.0-801.jdbc4.jar Test
java -classpath "postgresql-9.0-801.jdbc4.jar" Test
What am I doing wrong?
Hello!
source
share