Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 12-12-2007, 04:38 PM
Member
 
Join Date: Dec 2007
Posts: 2
Fukushuusha is on a distinguished road
Error while connecting to a database
I am trying to connect to a database with postgresql. I am not going to include the code in the post in order to save space, but it is not something complicated. Just connecting to a DB , nothing more. Other friends of mine said they did it exactly like that but my code does not work. It compiles all right, but when I try to run I get this error :

Exception in thread "main" java.lang.UnsupportedClassVersionError: Bad version number in .class file
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java :620)
at java.security.SecureClassLoader.defineClass(Secure ClassLoader.java:124)
at java.net.URLClassLoader.defineClass(URLClassLoader .java:260)
at java.net.URLClassLoader.access$100(URLClassLoader. java:56)
at java.net.URLClassLoader$1.run(URLClassLoader.java: 195)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.j ava:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:3 06)
at sun.misc.Launcher$AppClassLoader.loadClass(Launche r.java:268)
at java.lang.ClassLoader.loadClass(ClassLoader.java:2 51)
at java.lang.ClassLoader.loadClassInternal(ClassLoade r.java:319)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:164)
at Ergastirio5.main(Ergastirio5.java:48)

UnsupportedVersion ... none of my friends get this error? What could I have done wrong? Anyone knows? It is the first time I ever try to make a program which connects to a DB and I am not at all familiar with this. Thanks in advance for any help. Oh and if you do need the code to see it just tell me and I will post it in.
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 12-14-2007, 12:14 PM
Member
 
Join Date: Dec 2007
Posts: 32
felixtfelix is on a distinguished road
Can you check the driverversion jar files with your j2SDK version
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 12-16-2007, 10:40 AM
Member
 
Join Date: Dec 2007
Posts: 2
Fukushuusha is on a distinguished road
Hello friend, and thanks for answering. Unfortunately I have no idea how to check those files. I mean I don't understand which specific files you are proposing to check and check them for what? Thanks in advance for any answer.
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Connecting to a database peiceonly New To Java 2 04-06-2008 03:28 PM
problem in connecting to mysql database nancyv Java Servlet 6 04-02-2008 12:33 PM
Specifying the character set while connecting to the database Java Tip Java Tips 0 02-13-2008 12:26 PM
connecting to a database mxb7642 Database 1 12-05-2007 05:14 PM
connecting to mysql database javagal NetBeans 2 08-04-2007 01:36 PM


All times are GMT +3. The time now is 09:58 AM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org