public inbox for [email protected]  
help / color / mirror / Atom feed
Subject: [Pljava-dev] cannot set the classpath to a specific jar to get anexternal connection
Date: Thu, 3 Jun 2010 07:56:54 -0500
Message-ID: <8661B041D452404E8088FBD47D2443BE019EC515@NDCEXCUS703.int.asurion.com> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>
	<8661B041D452404E8088FBD47D2443BE019EC4FE@NDCEXCUS703.int.asurion.com>
	<[email protected]>

How are you connecting?  Is it something like this:

		Class.forName("org.postgresql.Driver");

		String connectionUrl = "jdbc:postgresql://" + server +
":" + port + "/" + database;

		conn = DriverManager.getConnection(connectionUrl,
userName, password);

Jon

-----Original Message-----
From: Luca Ferrari [mailto:fluca1978 at infinito.it] 
Sent: Thursday, June 03, 2010 7:50 AM
To: Roberts, Jon
Cc: pljava-dev at pgfoundry.org
Subject: Re: [Pljava-dev] cannot set the classpath to a specific jar to
get anexternal connection

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.<init>(ResultSetPicker.ja
va: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




view thread (8+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Subject: Re: [Pljava-dev] cannot set the classpath to a specific jar to get anexternal connection
  In-Reply-To: <8661B041D452404E8088FBD47D2443BE019EC515@NDCEXCUS703.int.asurion.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox