public inbox for [email protected]
help / color / mirror / Atom feedSubject: [Pljava-dev] cannot set the classpath to a specific jar to get anexternal connection
Date: Thu, 3 Jun 2010 07:15:30 -0500
Message-ID: <8661B041D452404E8088FBD47D2443BE019EC4FE@NDCEXCUS703.int.asurion.com> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>
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');
I use PL/Java to connect to other databases (Oracle, SQL Server, and
PostgreSQL) but I created a single Jar with all of my drivers and load
that to the database.
Jon
-----Original Message-----
From: pljava-dev-bounces at pgfoundry.org
[mailto:pljava-dev-bounces at pgfoundry.org] On Behalf Of Luca Ferrari
Sent: Thursday, June 03, 2010 3:53 AM
To: pljava-dev at pgfoundry.org
Subject: [Pljava-dev] cannot set the classpath to a specific jar to get
anexternal connection
Hi all,
not sure if what I'd like to do is possible, but I'd like to use JDBC
within a
pl/java function to extract data from another database (something
similar to
dbilink). However if I try to change the connection to another URL
rather that
"jdbc:default:connection" I got an error saying there is no suitable
driver,
so I tried to add explicitly the postgresql jar to the schema, but the
following fails:
select sqlj.set_classpath('public',
'/java/jars/postgresql-8.4-701.jdbc4.jar');
ERROR: java.sql.SQLException: No such jar:
/java/jars/postgresql-8.4-701.jdbc4.jar
So my questions are:
1) what am I missing in setting the classpath?
2) is it possible to open a connection to another database cluster?
Thanks,
Luca
_______________________________________________
Pljava-dev mailing list
Pljava-dev at pgfoundry.org
http://pgfoundry.org/mailman/listinfo/pljava-dev
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: <8661B041D452404E8088FBD47D2443BE019EC4FE@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