Forums | Admin

Discussion Forums: help

Start New Thread Start New Thread

 

By: Praveen Devarao
RE: Connection to I5/OS [ reply ]  
2009-02-05 07:17
Hi Tom,

Given that the db2level information is not retrieved, seems like your DB2 is not installed correctly. Re-check your post-installation process of creating the DB2INSTANCE and setting the LANG environment variable. If the problem still persist re-install DB2 properly and then try connecting to the i5 database.

FYI: - DB2 Connect is a Licensed product which is required to connect to i5 or zOS database. Hence this will not be available along with the DB2 Express-C edition.

If you are using the client machine just to connect to i5 and have no need for the complete Database engine on it then you can use the DB2 client (IBM Dataserver driver for ODBC and CLI) which is of very small footprint about 14-16 MB available at http://www-01.ibm.com/support/docview.wss?rs=71&uid=swg21288110 . You will just need to untar the archive, add the valid DB2 Connect license file in the license folder and set the env variable LD_LIBRARY_PATH to the lib directory of the client. With this you have the client environment setup and ready to use to connect to the remote database from your application.

Have a look at this link http://rubyforge.org/forum/forum.php?thread_id=28632&forum_id=9503 which will give you an idea on how easy it is to install the small footprint client and use to connect to a i5 or zOS machine. You can find the license usage related info for connecting to i5 using the IBM Dataserver Driver for ODBC and CLI at http://publib.boulder.ibm.com/infocenter/db2luw/v9r5/index.jsp?topic=/com.ibm.db2.luw.apdv.cli.doc/doc/r0024162.html

Let me know if you require more info.

P.S: - You might want to check with your i5 machine administrator for DB2 Connect license file.

Thanks

Praveen

By: Tom Van Looy
RE: Connection to I5/OS [ reply ]  
2009-02-05 06:46
I don't think I have DB2 connect installed, I do have DB2 Express-C for Linux. Isn't DB2 connect included with that?

By: Tom Van Looy
RE: Connection to I5/OS [ reply ]  
2009-02-05 06:44
$ /opt/ibm/db2/V9.5/bin/db2level
SQL10007N Message "-1390" could not be retrieved. Reason code: "3".

irb(main):001:0> require 'ibm_db'
=> true

irb(main):002:0> IBM_DB::connect 'DRIVER={IBM DB2 ODBC DRIVER};DATABASE=S123abcd;HOSTNAME=devel;PORT=446;PROTOCOL=TCPIP;UID=tvl;PWD=zzzzz;','',''
=> false

irb(main):003:0> puts IBM_DB.conn_errormsg
=> nil

Kind regards,

Tom

By: Praveen Devarao
RE: Connection to I5/OS [ reply ]  
2009-02-05 02:34
Hi Tom,

Could let me know your client level.

You can find this out by issuing the command db2level(if path is set appropriately). If path is not set to the bin folder of your DB2 client, navigate to bin folder and issue the db2level from that directory.

Also, can you retrieve the connection error message and let me know what it is. You can retrieve the connection error message by calling the method IBM_DB.conn_errormsg after the IBM_DB.connect method has returned a false (See Antonio's code snippet below).

Thanks

Praveen

By: Antonio Cangiano
RE: Connection to I5/OS [ reply ]  
2009-02-04 21:16
Hi Tom,

a couple of quick questions:

1) Do you have "DB2 Connect" installed?

2) What do you get when you run the following snippet?

require 'ibm_db'
IBM_DB::connect 'DRIVER={IBM DB2 ODBC DRIVER};DATABASE=S123abcd;HOSTNAME=devel;PORT=446;PROTOCOL=TCPIP;UID=tvl;PWD=zzzzz;','',''
puts IBM_DB.conn_errormsg


Thanks in advance,
Antonio


By: thaza th
RE: Connection to I5/OS [ reply ]  
2009-02-04 21:09
http://antoniocangiano.com/2008/02/08/essential-guide-to-the-ruby-driver-for-db2/

This link should help in resolving the IBM_DB related issues.

By: Tom Van Looy
Connection to I5/OS [ reply ]  
2009-02-04 19:43
I installed ruby (1.8.7), db2exc_950 and the ibm_db gem (1.0.1) on a Linux system. I would like to connect to an i5/OS database. I created a test program but it doesn't connect, no error messages. Here's the output of irb:

irb(main):001:0> require 'ibm_db'
=> true
irb(main):002:0> IBM_DB::connect 'DRIVER={IBM DB2 ODBC DRIVER}; DATABASE=S123abcd;HOSTNAME=devel;PORT=446;PROTOCOL=TCPIP;UID=tvl;PWD=zzzzz;','',''
=> false

It doesn't connect, if I put the result of this connection string into an object, it's false.

I don't know where to start searching, I had hoped I would get something like "connection refused", or "no such database", but it seems it doesn't work that way.

Are there any PTF requirements to get this thing working (we are pretty up to date).