Results 1 to 3 of 3
  1. #1
    tascoa is offline Member
    Join Date
    Oct 2008
    Posts
    16
    Rep Power
    0

    Default Error creating JDBC connection in Eclipse

    Hello.

    I have problem with creating jdbc connection in Eclipse 3.1. This connection I want to use in J2EE application.

    message:
    Error creating JDBC Connection connection to xxx@oracle. (Error: Bad version number in .class file)

    exception:

    java.lang.UnsupportedClassVersionError: Bad version number in .class file
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(Unknown Source)
    at java.security.SecureClassLoader.defineClass(Unknow n Source)
    at java.net.URLClassLoader.defineClass(Unknown Source)
    at java.net.URLClassLoader.access$100(Unknown Source)
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.net.FactoryURLClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at org.eclipse.datatools.connectivity.drivers.jdbc.JD BCConnection.createConnection(JDBCConnection.java: 205)
    at org.eclipse.datatools.connectivity.DriverConnectio nBase.internalCreateConnection(DriverConnectionBas e.java:104)
    at org.eclipse.datatools.connectivity.DriverConnectio nBase.open(DriverConnectionBase.java:53)
    at org.eclipse.datatools.connectivity.drivers.jdbc.JD BCConnection.open(JDBCConnection.java:72)
    at org.eclipse.datatools.enablement.internal.oracle.J DBCOracleConnectionFactory.createConnection(JDBCOr acleConnectionFactory.java:27)
    at org.eclipse.datatools.connectivity.internal.Connec tionFactoryProvider.createConnection(ConnectionFac toryProvider.java:83)
    at org.eclipse.datatools.connectivity.internal.Connec tionProfile.createConnection(ConnectionProfile.jav a:355)
    at org.eclipse.datatools.connectivity.internal.Manage dConnection.createConnection(ManagedConnection.jav a:166)
    at org.eclipse.datatools.connectivity.internal.Create ConnectionJob.run(CreateConnectionJob.java:56)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.j ava:55)


    Does anyone help me with it?

    Thanks.

  2. #2
    r035198x is offline Senior Member
    Join Date
    Aug 2009
    Posts
    2,388
    Rep Power
    10

    Default

    Check that
    1.) Your database driver is compatible with the Java version you are using.
    2.) You are running the program with a java version compatible with the compiler version that generated the .class files

  3. #3
    tascoa is offline Member
    Join Date
    Oct 2008
    Posts
    16
    Rep Power
    0

    Default

    Thanks a lot. The problem is I used for connect ojdbc6.jar. I try a ojdbc5.jar and it is OK. Thanks a lot once more.

Similar Threads

  1. JDBC Connection...
    By onlysumitg in forum JDBC
    Replies: 3
    Last Post: 08-21-2009, 11:34 AM
  2. Help me this error in JDBC-ODBC connection
    By lordelf in forum Java Servlet
    Replies: 3
    Last Post: 04-04-2009, 08:37 AM
  3. Replies: 0
    Last Post: 04-01-2008, 10:17 AM
  4. JDBC connection
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 11-10-2007, 08:39 PM
  5. Replies: 0
    Last Post: 09-28-2007, 12:56 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
  •