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 15:39:14 +0200
Message-ID: <[email protected]> (raw)
In-Reply-To: <8661B041D452404E8088FBD47D2443BE019EC515@NDCEXCUS703.int.asurion.com>
References: <[email protected]>
<[email protected]>
<8661B041D452404E8088FBD47D2443BE019EC515@NDCEXCUS703.int.asurion.com>
On Thursday 03 June 2010 02:56:54 pm Roberts, Jon's cat walking on the
keyboard wrote:
> 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);
Using either reflection or direct instantation I've got a new exception:
java.lang.NoClassDefFoundError: Could not initialize class
sun.security.provider.NativePRNG
at sun.security.provider.Sun.<init>(Sun.java:91)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method)
at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at java.lang.Class.newInstance0(Class.java:355)
at java.lang.Class.newInstance(Class.java:308)
at sun.security.jca.ProviderConfig$3.run(ProviderConfig.java:240)
at java.security.AccessController.doPrivileged(Native Method)
at
sun.security.jca.ProviderConfig.doLoadProvider(ProviderConfig.java:225)
at sun.security.jca.ProviderConfig.getProvider(ProviderConfig.java:205)
at sun.security.jca.ProviderList.getProvider(ProviderList.java:215)
at sun.security.jca.ProviderList.getService(ProviderList.java:313)
at sun.security.jca.GetInstance.getInstance(GetInstance.java:140)
at java.security.Security.getImpl(Security.java:659)
at java.security.MessageDigest.getInstance(MessageDigest.java:129)
at org.postgresql.util.MD5Digest.encode(MD5Digest.java:46)
at
org.postgresql.core.v3.ConnectionFactoryImpl.doAuthentication(ConnectionFactoryImpl.java:339)
at
org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:108)
at
org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:66)
at
org.postgresql.jdbc2.AbstractJdbc2Connection.<init>(AbstractJdbc2Connection.java:125)
at
org.postgresql.jdbc3.AbstractJdbc3Connection.<init>(AbstractJdbc3Connection.java:30)
at
org.postgresql.jdbc3g.AbstractJdbc3gConnection.<init>(AbstractJdbc3gConnection.java:22)
at
org.postgresql.jdbc4.AbstractJdbc4Connection.<init>(AbstractJdbc4Connection.java:30)
at
org.postgresql.jdbc4.Jdbc4Connection.<init>(Jdbc4Connection.java:24)
at org.postgresql.Driver.makeConnection(Driver.java:393)
at org.postgresql.Driver.connect(Driver.java:267)
at java.sql.DriverManager.getConnection(DriverManager.java:582)
at java.sql.DriverManager.getConnection(DriverManager.java:185)
at itpug.pljava.RowGenerator.getResultSet(RowGenerator.java:43)
at
org.postgresql.pljava.internal.ResultSetPicker.<init>(ResultSetPicker.java:25)
The code I use is the following:
public ResultSet getResultSet() throws SQLException {
org.postgresql.Driver driver = new org.postgresql.Driver();
Connection connection = DriverManager.getConnection( this.databaseName,
this.username, this.password );
Statement statement = connection.createStatement();
return statement.executeQuery(" SELECT * FROM "+ this.tableName );
}
Any idea?
Thanks,
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: <[email protected]>
* 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