Results 1 to 3 of 3
  1. #1
    Fukushuusha is offline Member
    Join Date
    Dec 2007
    Posts
    2
    Rep Power
    0

    Default 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.

  2. #2
    felixtfelix is offline Member
    Join Date
    Dec 2007
    Location
    Mumbai, India
    Posts
    37
    Rep Power
    0

    Default

    Can you check the driverversion jar files with your j2SDK version

  3. #3
    Fukushuusha is offline Member
    Join Date
    Dec 2007
    Posts
    2
    Rep Power
    0

    Default

    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.

Similar Threads

  1. connecting to a database
    By mxb7642 in forum JDBC
    Replies: 5
    Last Post: 09-08-2009, 09:39 AM
  2. Connecting to a database
    By peiceonly in forum New To Java
    Replies: 2
    Last Post: 04-06-2008, 03:28 PM
  3. problem in connecting to mysql database
    By nancyv in forum Java Servlet
    Replies: 6
    Last Post: 04-02-2008, 12:33 PM
  4. Replies: 0
    Last Post: 02-13-2008, 12:26 PM
  5. connecting to mysql database
    By javagal in forum NetBeans
    Replies: 2
    Last Post: 08-04-2007, 01:36 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •