| Message: 55973 |
 |
BY: Alex Pitigoi (alexp) DATE: 2008-05-16 18:07 SUBJECT: RE: Error connecting Oh, wait...
Now that you are using the "Thin CLI", you are no longer benefiting from the existence of the DB2 catalog, therefore you need a rather full connection string:
require 'ibm_db'
conn = IBM_DB::connect 'DRIVER={IBM DB2 ODBC DRIVER};DATABASE=railsdb;HOSTNAME=db2server.domain.com;PORT=50000;PROTOCOL=TCPIP;UID=userid;PWD=secret;', '', ''
IBM_DB::conn_errormsg
stmt = IBM_DB::exec conn, 'select schemaname from syscat.schemata'
IBM_DB::stmt_errormsg
while schemas = IBM_DB::fetch_assoc(stmt)
p schemas
end
| |