Skip to Main Content

Java Database Connectivity (JDBC)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

question about connection to firebird database

843859Mar 24 2008 — edited Mar 25 2008
Hi I'm a new JDBC programmer. I picked firebird because the application I wanted to make needed a server-less database. The database was easy to set up (I'm using the classic version of firebird) with isql, and I am now trying to access it through the JDBC. Here is my code, I know the code may be crude looking (I am new to it).
        try
        {
            Class.forName("org.firebirdsql.jdbc.FBDriver");
            Connection con = DriverManager.getConnection("jdbc:firebirdsql:localhost/3050:C:/test.gdb", "sysdba", "masterkey"); 
        }
        catch(ClassNotFoundException e)
        {
            System.out.println(e.getMessage());
        }
        catch(SQLException e)
        {
            System.out.println(e.getMessage());
        }
With this code, I recieved the following exception...:
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(SecureClassLoader.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.java:188)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
	at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
	at java.lang.Class.forName0(Native Method)
	at java.lang.Class.forName(Class.java:164)
	at DatabaseBoundary.hire(DatabaseBoundary.java:16)
	at DatabaseBoundary.<init>(DatabaseBoundary.java:9)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
	at bluej.runtime.ExecServer$3.run(ExecServer.java:808)
I have the most updated version of the JDK, and I have the most updated version of firebird (as of March 24, 2008 9:48 PM EST). I don't know why I am getting the UnsupportedClassVersionError, all help would be greatly appreciated. :)
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 22 2008
Added on Mar 24 2008
1 comment
244 views