I was using JDBC to connect to IBM DB2 AS400 for iSeries in my Rails Application. Now it looks like I will have to move to use the ibm_db
gem.
https://github.com/ibmdb/ruby-ibmdb
I attempted this with irb
first and used the following in a command like:
require 'ibm_db'
conn=IBM_DB.connect("DATABASE=ABCUATDT;hostname=TEST.HERE.COM;PORT=9471;SECURITY=SSL;PROTOCOL=TCPIP;AUTHENTICATION=SERVER;UID=username;PWD=abc1234;", "", "")
This gives me the following error:
SQL30081N A communication error has been detected. Communication protocol being used: \"SSL\". Communication API being used: \"SOCKETS\". Location where the error was detected: \"\". Communication function detecting the error: \"sqlccSSLSocketSetup\". Protocol specific error code(s): \"414\"
I then try without SSL:
conn=IBM_DB.connect("DATABASE=ABCUATDT;hostname=TEST.HERE.COM;PORT=446;PROTOCOL=TCPIP;AUTHENTICATION=SERVER;UID=username;PWD=abc1234;", "", "")
SQL30082N Security processing failed with reason \"15\" (\"PROCESSING FAILURE\"). SQLSTATE=08001 SQLCODE=-30082"
These ports and username/pw etc all work fine with JDBC, but not using the ibm_db gem.
EDIT: I tried using different ports, I know that 8471 is open for non-SSL and 9471 is open for SSL. I decided to skip SSL altogether and I started using the db2cli on my Mac OSX.
db2cli execsql -connstring "database=ABCUATDT;hostname=TEST.HERE.COM;port=8471;uid=username;pwd=abcd1234"
This just hangs and doesn't give me a prompt to write SQL:
IBM DATABASE 2 Interactive CLI Sample Program (C) COPYRIGHT International Business Machines Corp. 1993,1996 All Rights Reserved Licensed Materials - Property of IBM US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
I then tried the python library AND the DB2 CLI - both of which gave the same errors. Is there something needed to be changed at the DB2 side?
Why would it work for JDBC but not for the IBM ODBC driver?