IBM Support

JDBC Driver Error "Unable to Connect:  Unexpected error during test connection: Connection refused: connect"

Troubleshooting


Problem

When trying to connect using WebSphere Cast Iron to IBM Netezza with JDBC Driver using nzjdbc3.jar, the error SQLSTATE: 08001  ERRORCODE: 1114 Error Message: Connection refused: connect  occurs

Symptom

SEVERE: An error occurred while processing the message for the parameterized query activity at row number 0. The error is: Connection error while getting connection out of the pool. SQLSTATE: 08001  ERRORCODE: 1114 Error Message: Connection refused: connect 

Cause

Caused by: org.netezza.error.NzSQLException: Connection refused: connect                
    at org.netezza.sql.NzConnection.initSocket(NzConnection.java:2827)                  
    at org.netezza.sql.NzConnection.open(NzConnection.java:274)                         
    at org.netezza.datasource.NzDatasource.getConnection(NzDatasource.                  
java:602)                                                                               
    at org.netezza.datasource.NzDatasource.getConnection(NzDatasource.                  
java:589)                                                                               
    at org.apache.commons.dbcp.DataSourceConnectionFactory.                             
createConnection(DataSourceConnectionFactory.java:43)                                   
    at com.approuter.module.database.protocol.                                          
CIPoolableConnectionFactory.makeObject(CIPoolableConnectionFactory.java:                
86)                                                                                     
    at org.apache.commons.pool.impl.GenericObjectPool.borrowObject                      
(GenericObjectPool.java:974)                                                            
    at org.apache.commons.dbcp.PoolingDataSource.getConnection                          
(PoolingDataSource.java:96)                                                             
    at com.approuter.module.database.protocol.ConnectionManager.                        
getConnection(ConnectionManager.java:191)                                            

Environment

Windows (Microsoft)

Diagnosing The Problem

IBM Netezza team has property names different from JDBC specification hence the issue. The Netezza JDBC driver Nzjdbc3.jar has datasource property as Database in its Datasource implementation but per the JDBC specs, the standard datasource property should be DatabaseName as seen in Page 56 of the link:http://download.oracle.com/otn-pub/jcp/jdbc-4_1-mrel-spec/jdbc4.1-fr-spec.pdf?AuthParam=1454316831_78f6c2f70178da2061756458c30c0e24.
The standard JDBC specs have been implemented for all databases in Cast Iron code. It looks for setDatabaseName, setServerName and setPortNumber. IBM Netezza instead uses setDatabase, setHost and setPort methods and it fails to connect.

Resolving The Problem

Cast Iron created a solution to provide connection details to add the property names to workaround the issue

[{"Product":{"code":"SSULQD","label":"IBM PureData System"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Component":"IBM Netezza Analytics","Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"1.0.0","Edition":"Workstation","Line of Business":{"code":"LOB10","label":"Data and AI"}},{"Product":{"code":"SSUSQ8","label":"IBM Netezza Analytics"},"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Component":" ","Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"Version Independent","Edition":"Workstation","Line of Business":{"code":"LOB10","label":"Data and AI"}}]

Document Information

Modified date:
03 June 2022

UID

swg21977631