I'm using Eclipse to build a program. There is one class that connects postgresql DB, and I have included postgresql-8.3-604.jdbc3.jar in the Java build path. There is no compilation error appearing in Eclipse. There is also no compilation error when I build it using ant. But when I try to run the generated runnable Jar file. Then it starts to complain:
reubin haz wrote:run the generated runnable Jar file
Is the driver in the classpath of the runtime environment of that JAR file?
According to the exception you're not loading the driver at all, or you're suppressing any ClassNotFoundException of the driver (you shouldn't be doing that, it would only lead to misleading exceptions which come after), or the URL is actually wrong (after a quick scan of PostgreSQL JDBC docs the jdbc:postgresql prefix is just fine).