dbTalk Databases Forums  

[Info-Ingres] Newby Java connection issue

comp.databases.ingres comp.databases.ingres


Discuss [Info-Ingres] Newby Java connection issue in the comp.databases.ingres forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Martin Bowes
 
Posts: n/a

Default [Info-Ingres] Newby Java connection issue - 05-14-2012 , 07:56 AM






Hi All,

I'm starting some experiments writing java code to connect to an Ingres database.

I'm using a Linux box to develop.

I've set CLASSPATH to $II_SYSTEM/ingres/lib/iijdbc.jar:.

The initial code compiles OK with javac, but when I attempt to execute the class I get:
Exception in thread "main" java.lang.ClassFormatError: com.ingres.jdbc.IngresDriver (unrecognized class file version)

Any ideas what I'm missing?

Marty

Reply With Quote
  #2  
Old   
Roy Hann
 
Posts: n/a

Default Re: [Info-Ingres] Newby Java connection issue - 05-14-2012 , 08:17 AM






Martin Bowes wrote:

Quote:
Hi All,

I'm starting some experiments writing java code to connect to an Ingres database.

I'm using a Linux box to develop.

I've set CLASSPATH to $II_SYSTEM/ingres/lib/iijdbc.jar:.

The initial code compiles OK with javac, but when I attempt to execute the class I get:
Exception in thread "main" java.lang.ClassFormatError: com.ingres.jdbc.IngresDriver (unrecognized class file version)

Any ideas what I'm missing?
That rings a bell. I think I ran into that last year some time. My
java and javac versions where out of sync.

--
Roy

UK Actian User Association Conference 2012 will be on Tuesday June 19 2012.
Register now at https://www.regonline.co.uk/ukiua2012
The latest information is available from www.uk-iua.org.uk.

Reply With Quote
  #3  
Old   
Paul Mason
 
Posts: n/a

Default Re: [Info-Ingres] Newby Java connection issue - 05-14-2012 , 08:29 AM



What version of Java are you using? Is it possible you're picking up
javac from a later version than java itself?



Java -version

Javac -version



From: info-ingres-bounces (AT) kettleriver...ting (DOT) com
[mailto:info-ingres-bounces (AT) kettleriverconsulting (DOT) com] On Behalf Of
Martin Bowes
Sent: 14 May 2012 13:56
To: info-ingres (AT) kettleriverconsulting (DOT) com
Subject: [Info-Ingres] Newby Java connection issue



Hi All,



I'm starting some experiments writing java code to connect to an Ingres
database.



I'm using a Linux box to develop.



I've set CLASSPATH to $II_SYSTEM/ingres/lib/iijdbc.jar:.



The initial code compiles OK with javac, but when I attempt to execute
the class I get:

Exception in thread "main" java.lang.ClassFormatError:
com.ingres.jdbc.IngresDriver (unrecognized class file version)



Any ideas what I'm missing?



Marty

Reply With Quote
  #4  
Old   
Martin Bowes
 
Posts: n/a

Default Re: [Info-Ingres] Newby Java connection issue - 05-14-2012 , 08:39 AM



Hi Roy,

java --version
java version "1.4.2"
gij (GNU libgcj) version 4.1.1 20070105 (Red Hat 4.1.1-52)

Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

javac -version
Eclipse Java Compiler v_677_R32x, 3.2.1 release, Copyright IBM Corp 2000, 2006. All rights reserved.

Marty
From: Martin Bowes [mailto:martin.bowes (AT) ctsu (DOT) ox.ac.uk]
Sent: 14 May 2012 13:56
To: info-ingres (AT) kettleriverconsulting (DOT) com
Subject: [Info-Ingres] Newby Java connection issue

Hi All,

I'm starting some experiments writing java code to connect to an Ingres database.

I'm using a Linux box to develop.

I've set CLASSPATH to $II_SYSTEM/ingres/lib/iijdbc.jar:.

The initial code compiles OK with javac, but when I attempt to execute the class I get:
Exception in thread "main" java.lang.ClassFormatError: com.ingres.jdbc.IngresDriver (unrecognized class file version)

Any ideas what I'm missing?

Marty

Reply With Quote
  #5  
Old   
Roy Hann
 
Posts: n/a

Default Re: [Info-Ingres] Newby Java connection issue - 05-14-2012 , 09:18 AM



Martin Bowes wrote:

Quote:
Hi Roy,

java --version
java version "1.4.2"
gij (GNU libgcj) version 4.1.1 20070105 (Red Hat 4.1.1-52)

Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

javac -version
Eclipse Java Compiler v_677_R32x, 3.2.1 release, Copyright IBM Corp 2000, 2006. All rights reserved.
I have no idea if those are compatible.

My java dev system shows:

c:\temp>javac -version
javac 1.6.0_22

c:\temp>java -version
java version "1.6.0_22"
Java(TM) SE Runtime Environment (build 1.6.0_22-b04)
Java HotSpot(TM) Client VM (build 17.1-b03, mixed mode, sharing)

--
Roy

UK Actian User Association Conference 2012 will be on Tuesday June 19 2012.
Register now at https://www.regonline.co.uk/ukiua2012
The latest information is available from www.uk-iua.org.uk.

Reply With Quote
  #6  
Old   
Martin Bowes
 
Posts: n/a

Default Re: [Info-Ingres] Newby Java connection issue - 05-14-2012 , 09:24 AM



Ok a fresh install: yum install *jdk* and suddenly java and javac have the same version and the test program is now working!

Hurrah!

Marty

From: Martin Bowes [mailto:martin.bowes (AT) ctsu (DOT) ox.ac.uk]
Sent: 14 May 2012 13:56
To: info-ingres (AT) kettleriverconsulting (DOT) com
Subject: [Info-Ingres] Newby Java connection issue

Hi All,

I'm starting some experiments writing java code to connect to an Ingres database.

I'm using a Linux box to develop.

I've set CLASSPATH to $II_SYSTEM/ingres/lib/iijdbc.jar:.

The initial code compiles OK with javac, but when I attempt to execute the class I get:
Exception in thread "main" java.lang.ClassFormatError: com.ingres.jdbc.IngresDriver (unrecognized class file version)

Any ideas what I'm missing?

Marty

Reply With Quote
  #7  
Old   
Ingres Forums
 
Posts: n/a

Default Re: [Info-Ingres] Newby Java connection issue - 05-14-2012 , 10:23 AM



Not sure what Ingres JDBC driver you are using but 4.0.x requires Java
1.6 as a minimum.

See 'Ingres Java Development Center/Ingres Java Learn - Ingres Community
Wiki' (http://tinyurl.com/79trl7z) for minimum JRE versions for various
Ingres JDBC drivers.

Regards,
Teresa


--
teresa

Reply With Quote
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



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.