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