pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Fwd: Rocks 6.1.1 with JDBC connection - What should be wrong?
2+ messages / 2 participants
[nested] [flat]

* Fwd: Rocks 6.1.1 with JDBC connection - What should be wrong?
@ 2014-11-25 15:18 Luciana Campos <lumascampos@gmail.com>
  2014-11-26 17:16 ` Re: Fwd: Rocks 6.1.1 with JDBC connection - What should be wrong? John R Pierce <pierce@hogranch.com>
  0 siblings, 1 reply; 2+ messages in thread

From: Luciana Campos @ 2014-11-25 15:18 UTC (permalink / raw)
  To: pgsql-bugs

Hello,

I am having trouble configuring JDBC4 with Rocks 6.1.1.
It's possible to connect database with 'psql', but using the JDBC
connection, I got this error:

Exception in thread "main"
java.lang.NoClassDefFoundError: org/postgresql/jdbc4/Jdbc4Connection
at org.postgresql.Driver.makeConnection(Driver.java:410)
at org.postgresql.Driver.connect(Driver.java:280)
at java.sql.DriverManager.getConnection(DriverManager.java:571)
at java.sql.DriverManager.getConnection(DriverManager.java:215)
at testaconexao.TestaConexao.main(TestaConexao.java:40)
Caused by: java.lang.ClassNotFoundException:
org.postgresql.jdbc4.Jdbc4Connection
at java.net.URLClassLoader$1.run(URLClassLoader.java:363)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
... 5 more
Caused by: java.io.EOFException: Detect premature EOF
at sun.misc.Resource.getBytes(Resource.java:131)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:444)
at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
... 10 more

I'm using :

   - JAVA J2SE

java version "1.7.0_51"
Java(TM) SE Runtime Environment (build 1.7.0_51-b13)
Java HotSpot(TM) 64-Bit Server VM (build 24.51-b03, mixed mode)


   - PostgreSQL

PostgreSQL 9.3.5 on x86_64-unknown-linux-gnu, compiled by gcc (GCC) 4.4.7
20120
313 (Red Hat 4.4.7-4), 64-bit


   - JDBC4

postgresql-9.2-1004.jdbc41.jar


What should be wrong?

Luciana.

^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: Fwd: Rocks 6.1.1 with JDBC connection - What should be wrong?
  2014-11-25 15:18 Fwd: Rocks 6.1.1 with JDBC connection - What should be wrong? Luciana Campos <lumascampos@gmail.com>
@ 2014-11-26 17:16 ` John R Pierce <pierce@hogranch.com>
  0 siblings, 0 replies; 2+ messages in thread

From: John R Pierce @ 2014-11-26 17:16 UTC (permalink / raw)
  To: pgsql-bugs

On 11/25/2014 7:18 AM, Luciana Campos wrote:
> I am having trouble configuring JDBC4 with Rocks 6.1.1.
> It's possible to connect database with 'psql', but using the JDBC 
> connection, I got this error:
>
> Exception in thread "main"
> java.lang.NoClassDefFoundError: org/postgresql/jdbc4/Jdbc4Connection
> .....
> postgresql-9.2-1004.jdbc41.jar

thats not the latest driver, 
http://jdbc.postgresql.org/download/postgresql-9.3-1102.jdbc41.jar is.  
ignore the 9.3 vs 9.2, they are the same thing.   1104 is the current 
version.


-- 
john r pierce                                      37N 122W
somewhere on the middle of the left coast

^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2014-11-26 17:16 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2014-11-25 15:18 Fwd: Rocks 6.1.1 with JDBC connection - What should be wrong? Luciana Campos <lumascampos@gmail.com>
2014-11-26 17:16 ` John R Pierce <pierce@hogranch.com>

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