From: fluca1978 at infinito.it (Luca Ferrari) Date: Thu, 3 Jun 2010 14:50:09 +0200 Subject: [Pljava-dev] cannot set the classpath to a specific jar to get anexternal connection In-Reply-To: <8661B041D452404E8088FBD47D2443BE019EC4FE@NDCEXCUS703.int.asurion.com> References: <201006031052.33192.fluca1978@infinito.it> <8661B041D452404E8088FBD47D2443BE019EC4FE@NDCEXCUS703.int.asurion.com> Message-ID: <201006031450.10453.fluca1978@infinito.it> On Thursday 03 June 2010 02:15:30 pm Roberts, Jon's cat walking on the keyboard wrote: > I think you need to first install the jar and then set the class path. > > For example: > select * from > sqlj.install_jar('file:///java/jars/postgresql-8.4-701.jdbc4.jar', > 'example_jar', true); > select sqlj.set_classpath('public', 'example_jar'); > Yes, I've installed the jar before ( I did not mention) and then I was able to set the classpath using the jar alias. However, keeping the jar separated or merging them into a single jar does not solve the problem and the error still is: ERROR: java.sql.SQLException: No suitable driver found for jdbc:postgresql://localhost/myDb and in the logs I've got the stacktrace: java.sql.SQLException: No suitable driver found for jdbc:postgresql://localhost/myDB at java.sql.DriverManager.getConnection(DriverManager.java:602) at java.sql.DriverManager.getConnection(DriverManager.java:185) at itpug.pljava.RowGenerator.getResultSet(RowGenerator.java:40) at org.postgresql.pljava.internal.ResultSetPicker.(ResultSetPicker.java:25) Summarizing this is what I've done: 1) sqlj.replace_jar to my new jar containing the Java client 2) sqlj.install_jar for the postgresql driver jar 3) set the classpath so that now I've got: select sqlj.get_classpath('public'); get_classpath --------------- driver:myJar (1 row) with driver the jar for the jdbc driver, and myjar the jar of my client. Any suggestion? Luca