Connect from Windows using JDBC
1 posts in topic
Flat View  Flat View

Posted By:   enrico_giauna
Posted On:   Wednesday, July 10, 2002 07:38 AM

Hi to all!

I've installed PostgreSQL on Linux. I'm able to access DB through JDBC (using JSP) from server, but now I've got to develop a Java client interface to access DB from WINDOWS remote hosts.
Where I've got to put JDBC (postgresql.jar) and what I've to configure on windows?
I compile the same file java that I use on Linux with "javac -classpath postgresql.jar Connect.java" (postgresql.jar is in the same directory of .java), but when it runs (java Connect) it returns me an exception : it couldn't find org.postgresql.Driver.

What shall I do?

Thanks a lot

Re: Connect from Windows using JDBC

Posted By:   Simone_Re  
Posted On:   Wednesday, July 10, 2002 08:48 AM

I think you must use -classpath option also when you run your class. ("java -classpath postgresql.jar Connect").

If you obtain a "java.lang.NoClassDefFoundError: Connect" you must include in the classpath also the directory of Connect.class

(for examples: "java -classpath c:path_to_postgresql_driverpostgresql.jar;c:path_to_connect_classConnect.class Connect").


About | Sitemap | Contact