-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Need help in connecting To PostgreSQL
PostPosted: Mon Sep 21, 2009 2:50 pm 
Newbie

Joined: Sun Sep 13, 2009 12:56 am
Posts: 4
Hi All

I am trying to connect to PostgreSQL DB, and getting problem

Quote:
java.lang.UnsupportedClassVersionError: Bad version number in .class file
java.lang.ClassLoader.defineClass1(Native Method)
java.lang.ClassLoader.defineClass(Unknown Source)
java.security.SecureClassLoader.defineClass(Unknown Source)
org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:1847)
org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:873)
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1326)
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1205)
java.lang.ClassLoader.loadClassInternal(Unknown Source)
java.lang.Class.forName0(Native Method)
java.lang.Class.forName(Unknown Source)
org.hibernate.connection.DriverManagerConnectionProvider.configure(DriverManagerConnectionProvider.java:57)
org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:80)
org.hibernate.cfg.SettingsFactory.createConnectionProvider(SettingsFactory.java:362)
org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:60)
org.hibernate.cfg.Configuration.buildSettings(Configuration.java:1463)
org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1004)
controller.MainServlet.doPost(MainServlet.java:30)
javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)


My cfg file looks like below..

Code:
<session-factory>
   <property name="connection.username">postgres</property>
   <property name="connection.url">jdbc:postgresql://localhost:5432/nikdb</property>
   <property name="dialect">org.hibernate.dialect.PostgreSQLDialect</property>
   <property name="connection.password">tiger</property>
   <property name="connection.driver_class">org.postgresql.Driver</property>
   <property name="show_sql">true</property>
   <mapping resource="controller/all.hbm.xml" />

</session-factory>


I am using
Quote:
postgresql-8.4-701.jdbc4.jar

and DB version is 8.4


Top
 Profile  
 
 Post subject: Re: Need help in connecting To PostgreSQL
PostPosted: Mon Sep 21, 2009 7:02 pm 
Newbie

Joined: Fri Jan 23, 2009 8:01 pm
Posts: 13
Check that your JDK version is compatible. I use 8.3 jdbc3 w/ JDK 1.5 no problem. jdbc4 requires 1.6 I believe. Maybe try with 8.4 jdbc3 and see if you get any headway.

http://jdbc.postgresql.org/download.html


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.