DB2 JDBC connection error

elgeo
Valued Contributor II

Hello. I am trying to establish a connection from Databricks to our DB2 AS400 server. Below is my code:

CREATE TABLE IF NOT EXISTS table_name

USING JDBC

OPTIONS (DRIVER = "com.ibm.as400.access.AS400JDBCDriver", URL = "jdbc:as400://<IP>:446;prompt=false", dbtable="<SCHEMA>.<TABLE_NAME>", user = "USER1", password="XXXXX" )

However I get the following error:

Error in SQL statement: SQLException: The application requester cannot establish the connection. (Connection was dropped unexpectedly.)

Connection to the specific IP address succeeds:

jdbc_error