Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[Info-Ingres] Installing and using an Ingres JDBC connection

337 views
Skip to first unread message

Richard Harden

unread,
Jun 10, 2009, 1:12:03 AM6/10/09
to Ingres and related product discussion forum

Greetings All,

 

I have no experience in setting up and configuring a JDBC connection to an Ingres database.

 

I am trying to experiment with iReport connecting to Ingres 9.2 (win32) but I don’t know how to setup (or even if its installed) a jdbc connection.

 

The directions I was given was

 

1.       From esd.ingres.com/product downloads ... download applicable jdbc driver for your version of Ingres

First problem.  There is no mention of any jdbc drivers there that I can find.

 

 

Then goes on to say extract the iijdbc.jar and copy to the iReports libs folder (can find that)

 I found an iijdbc.jar in %II_SYSTEM%\Ingres\lib directory so I tried copying that to the specified directory.

 

 

Reading the connectivity guide, I found the bit that said that the jdbc can be tested using

‘java jdbcinfo’ command

 

Tried running that and all I got was

Exception in thread "main" java.lang.NoClassDefFoundError: jdbcinfo

Caused by: java.lang.ClassNotFoundException: jdbcinfo

        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 sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)

        at java.lang.ClassLoader.loadClass(Unknown Source)

        at java.lang.ClassLoader.loadClassInternal(Unknown Source)

Could not find the main class: jdbcinfo.  Program will exit.

 

I have a full installation of Ingres 9.2 including the .NET data provider

 

IVM shows its up and running, with a listen of II7

 

Its probably a newbie problem, but

What am I doing wrong, where should I be going?

 

TIA

 

Dic Harden

John Dennis

unread,
Jun 10, 2009, 1:48:25 AM6/10/09
to Ingres and related product discussion forum
Richard,
 
java is case sensitive. If you "cd" to the ingres\lib directory and then issue the command "java JdbcInfo" you should get a better result. or you might - do you have the classpath variable defined? If you set CLASSPATH=%II_SYSTEM\ingres\lib\iijdbc.jar;.; you should then be able to run that command from the lib directory. If you are running 9.2 the answer should be something like:
 
Ingres Corporation - JDBC Driver [3.4.7]
 
John


From: info-ingr...@kettleriverconsulting.com [mailto:info-ingr...@kettleriverconsulting.com] On Behalf Of Richard Harden
Sent: Wednesday, 10 June 2009 3:12 PM
To: 'Ingres and related product discussion forum'
Subject: [Info-Ingres] Installing and using an Ingres JDBC connection

Richard Harden

unread,
Jun 10, 2009, 2:40:44 AM6/10/09
to Ingres and related product discussion forum

Hi John,

 

 

If I run java JdbcInfo from the ingres lib directory I get

##

d:\IngresII\ingres\lib>java JdbcInfo

Error loading driver class 'com.ingres.jdbc.IngresDriver':

com.ingres.jdbc.IngresDriver

 

d:\IngresII\ingres\lib>

##

 

If I set  CLASSPATH=%II_SYSTEM%\ingres\lib\iijdbc.jar

Then tried again

##

d:\IngresII\ingres\lib>set  CLASSPATH=%II_SYSTEM%\ingres\lib\iijdbc.jar

 

d:\IngresII\ingres\lib>java JdbcInfo

Exception in thread "main" java.lang.NoClassDefFoundError: JdbcInfo

Caused by: java.lang.ClassNotFoundException: JdbcInfo

        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 sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)

        at java.lang.ClassLoader.loadClass(Unknown Source)

        at java.lang.ClassLoader.loadClassInternal(Unknown Source)

Could not find the main class: JdbcInfo.  Program will exit.

 

d:\IngresII\ingres\lib>

##

 

If I set the class path to the directory, rather than the single file I get

##

d:\IngresII\ingres\lib>set  CLASSPATH=%II_SYSTEM%\ingres\lib\iijdbc.jar

 

d:\IngresII\ingres\lib>java JdbcInfo

Exception in thread "main" java.lang.NoClassDefFoundError: JdbcInfo

Caused by: java.lang.ClassNotFoundException: JdbcInfo

        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 sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)

        at java.lang.ClassLoader.loadClass(Unknown Source)

        at java.lang.ClassLoader.loadClassInternal(Unknown Source)

Could not find the main class: JdbcInfo.  Program will exit.

 

d:\IngresII\ingres\lib>set  CLASSPATH=%II_SYSTEM%\ingres\lib

 

d:\IngresII\ingres\lib>java JdbcInfo

Error loading driver class 'com.ingres.jdbc.IngresDriver':

com.ingres.jdbc.IngresDriver

 

d:\IngresII\ingres\lib>

##

 

LIB is defined correctly

And the contents of the lib folder is

d:\IngresII\ingres\lib>dir

 Volume in drive D is D_Data_Disk

 Volume Serial Number is 3425-A1AC

 

 Directory of d:\IngresII\ingres\lib

 

10/06/2009  05:12 p.m.    <DIR>          .

10/06/2009  05:12 p.m.    <DIR>          ..

17/03/2009  09:48 a.m.               922 abfimain.obj

17/03/2009  09:48 a.m.               981 abfmain.obj

03/12/2008  01:06 p.m.               961 DrvInfo.class

17/03/2009  09:48 a.m.           202,972 edbc.jar

03/12/2008  01:06 p.m.             4,181 EdbcInfo.class

17/03/2009  09:41 a.m.               644 Iiclsadt.obj

11/04/2009  02:41 a.m.            15,698 iiiceapi.lib

17/03/2009  05:23 p.m.           318,451 iijdbc.jar

11/04/2009  02:13 a.m.            13,784 iilibapi.lib

11/04/2009  02:35 a.m.             7,376 iilibutil.lib

17/03/2009  09:41 a.m.               644 iiuseradt.obj

03/12/2008  01:06 p.m.             6,896 JdbcInfo.class

11/04/2009  02:29 a.m.         2,225,434 libingres.lib

17/03/2009  10:09 a.m.           752,732 libspat.lib

17/03/2009  09:53 a.m.           160,256 oiutil.doc

              15 File(s)      3,711,932 bytes

               2 Dir(s)  189,443,981,312 bytes free

 

So, anymore suggestions John?

 

Cheers

Dic

John Dennis

unread,
Jun 10, 2009, 2:50:16 AM6/10/09
to Ingres and related product discussion forum
Hi Richard,
 
set CLASSPATH=%II_SYSTEM%\ingres\lib\iijdbc.jar;.;
 
Note the semi-colons and full-stop at the end - the "." means to include the current directory in the CLASSPATH, so when you have cd'd to the lib directory it will find the JdbcInfo.class file.
 
Note also, this test doesn't require the DAS server to be running. It doesnt connect to the database.
 
BTW, I am sure there are "more proper" ways to do this, but this works for me...
 
John


Sent: Wednesday, 10 June 2009 4:41 PM

To: 'Ingres and related product discussion forum'

ghin...@yahoo.co.uk

unread,
Jun 10, 2009, 4:07:50 AM6/10/09
to
Richard,

=================================================
To test that you have a good JDBC driver, try the following: -
=================================================

1/ Ensure you have the files "JdbcInfo.class" and "iijdbc.jar" inside
your %II_SYSTEM%\ingres\lib directory

2/ At the DOS command prompt use the following command (you can be in
any directory) : -

java -cp %II_SYSTEM%\ingres\lib;%II_SYSTEM%\ingres\lib\iijdbc.jar
JdbcInfo

If all is OK, you should see information about the JDBC driver
release

=================================================
Your Java reporting problem
=================================================

1/ All operating systems have a set of directories they will search to
resolve a command. Java is the same but for programs and classes that
make up programs. For Java this is the CLASSPATH variable which is set
at the operating system level before you start any Java program.

2/ In the case of your reporting program, normally there will be a
configuration file (or screen) that will describe where the program
looks for JDBC drivers (you enter the full path name and .JAR file
name). Think of the .JAR file as a ZIP file because that is what it
is.. you can use 7-zip to explore it :-) Just saves copying lots of
directory structures and keeps things tidy. The classname (driver) you
want from this file is called "com.ingres.jdbc.IngresDriver", which if
you explorer the .JAR file you'll see there's a file called
IngresDriver.class in the sub-directory of com\ingres\jdbc. The report
program will want to know this classname.

3) So now the report program should be configured to load the
iijdbc.jar file in the %II_SYSTEM%\ingres\lib area and use the class
called "com.ingres.jdbc.IngresDriver".

=================================================
Finally - using the JDBC driver
=================================================

1/ Now you've got the JDBC driver loaded into the reporting program,
you'll have to supply the URL for where it must go to find the Ingres
database (it's name/node/port/password etc)...

For Ingres you use the following structure: -

jdbc:ingres://host:port/db

so something like

jdbc:ingres://host:II7/testdb

the II7 is usually the default for the JDBC server component on an
ingres system configured with the installation code of II (but use CBF
on the system to see what the real port is).

=================================================

Hope this helps to clarify

Cheers

Gary

Richard Harden

unread,
Jun 10, 2009, 4:38:31 AM6/10/09
to Ingres and related product discussion forum

Righty-Ho,

 

Got the syntax correct this time, and from the ingres\lib directory, I now get the correct response.

 

Onward and upward,

 

Thanks John.

Richard Harden

unread,
Jun 10, 2009, 5:28:17 AM6/10/09
to Ingres and related product discussion forum
Thanks Gary,

A truly helpful explanation.

Based on what John had said earlier, and your explanation I was able to get
a correct response from the 'java jdbcinfo' (yes, I now realise its also
case-sensitive)

That done, I set the CLASSPATH as suggested as a system environment
variable. (I was manually setting it in a dos window whilst testing)

Once that was done, I re-started iReports and the ingres jdbc was now
available

Successfully created and tested a connection to my db, so its now only a
matter of experimenting / learning iReports


To all who replied,


Thanks a-lot you guys are life-savers.
Dic.

-----Original Message-----
From: info-ingr...@kettleriverconsulting.com
[mailto:info-ingr...@kettleriverconsulting.com] On Behalf Of
ghin...@yahoo.co.uk
Sent: Wednesday, 10 June 2009 8:08 p.m.
To: info-...@kettleriverconsulting.com
Subject: Re: [Info-Ingres] Installing and using an Ingres JDBC connection

Richard,

jdbc:ingres://host:port/db

so something like

jdbc:ingres://host:II7/testdb

=================================================

Cheers

Gary
_______________________________________________
Info-Ingres mailing list
Info-...@kettleriverconsulting.com
http://www.kettleriverconsulting.com/mailman/listinfo/info-ingres


0 new messages