LUW DB2 JDBC Connection Issue on Open JDK 11 - db2

I am not able to connect LUW DB2 database using JDBC Type4 driver on Open Zulu JDK 11.
I have tried all available latest DB2 JDBC Drivers (Type 4) but same issue with all drivers on JDK 11. Things are working fine on JDK 8.
Getting below error
Exception in thread "main" java.lang.NumberFormatException: For input string: "B"
at java.base/java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
at java.base/java.lang.Integer.parseInt(Integer.java:652)
at java.base/java.lang.Integer.parseInt(Integer.java:770)
at com.ibm.db2.jcc.c.xc.<init>(xc.java:64)
at com.ibm.db2.jcc.b.f.<init>(f.java:44)
at com.ibm.db2.jcc.b.b.cb(b.java:1945)
at com.ibm.db2.jcc.c.p.a(p.java:3284)
at com.ibm.db2.jcc.b.b.a(b.java:625)
at com.ibm.db2.jcc.b.b.<init>(b.java:334)
at com.ibm.db2.jcc.DB2Driver.connect(DB2Driver.java:165)
at java.sql/java.sql.DriverManager.getConnection(DriverManager.java:677)
at java.sql/java.sql.DriverManager.getConnection(DriverManager.java:228)
at com.aonhewitt.Test.main(Test.java:14)
Test Java Code
Class.forName("com.ibm.db2.jcc.DB2Driver");
Connection conn = DriverManager.getConnection("jdbc:db2://hostname:port/database","userid","password");
I would appreciate if anyone can help me here to connect to a DB2-LUW database from JDK 11
C:\>java -cp db2jcc4.jar com.ibm.db2.jcc.DB2Jcc -version
IBM Data Server Driver for JDBC and SQLJ 4.25.23
C:\>java -cp jcc-11.5.4.0.jar com.ibm.db2.jcc.DB2Jcc -version
IBM Data Server Driver for JDBC and SQLJ 4.27.25

Related

Unable to conect oci8 driver with oracle 19c database with php 8.1

I'm trying to connect to oracle 19c database with 12c client with php version 8.1.getting below error.
Message: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated
Filename: oci8/oci8_driver.php
Line Number: 160
Is there anything Ineed to install.I'm using 12c client(administrator)

MySQL-Workbench Connection Fail

Try to ask a question because the DB connection in MySQL Workbench continues to fail.
Enter connection information and Test Connection was successful.
However if i select the appropriate DB Connection in workbench home, the connection success window does not appear.
local DB : mysql Ver 15.1 Distrib 10.3.14-MariaDB, for Win64 (AMD64), source revision ab7b9cf9122f6eb02744082db8672a920ae6009f
Server DB : mysql Ver 15.1 Distrib 10.3.14-MariaDB, for Win64 (AMD64), source revision ab7b9cf9122f6eb02744082db8672a920ae6009f
MySQL Workbench Version : mysql-workbench-community-8.0.16-winx64
The same error occurs even if the version of Workbench is changed to 19 or 20.
How to solve it?
Manage Server Connections - screenshot
MySQL Workbench - screenshot
------More details---------
If you check the log file in the top Help tab of Workbench, you can see the log as below.
11:23:15 [INF][SQL Editor Form]: Opened connection 'DB Name' to mariadb.org binary distribution version 10.3.14-MariaDB
11:23:15 [ERR][ WBContext]: Unsupported server version: mariadb.org binary distribution 10.3.14-MariaDB
However, the connection is normally established on the other coworker's PC.

How to connect in db2 LUW with SSL using python?

I'M running SQL queries (client side) from DB2 databases using ibm_db & ibm_db_dbi using pandas. However one of our datasource implemented new security.I'm running Python3.7 and DB2 11.0
Below is my current connection string:
dsn = (
"DRIVER={{IBM DB2 ODBC DRIVER}};"
"DATABASE={0};"
"HOSTNAME={1};"
"PORT={2};"
"PROTOCOL=TCPIP;"
"UID={3};"
"PWD={4};"
"Security={5};"
"SSLClientKeystoredb={6};"
"SSLClientKeystoreDBPassword={7};").format(dsn_database, dsn_hostname, dsn_port, dsn_uid, dsn_pwd, dsn_security, dsn_keystore, dsn_keypwd)
And I have an error message:
Exception Traceback (most recent call last)
in ()
----> 1 con= ibm_db.connect(dsn, "", "")
SQLCODE=-1109on: [IBM][CLI Driver] SQL1109N The specified DLL "GSKit Error: 202" could not be loaded. SQLSTATE=42724
I also look for GSKit and install it in my machine, then put it on the Path for environment variable but error still persists.
Hope you can help me with this problem.

Cant import table to H2O, using Postgresql JDBC in Ubuntu

I am having trouble to import a sql table to H2O.ai using Postgresql JDBC Driver in Ubuntu. I'm getting the follow error:
ERROR MESSAGE:
SQLException: ERROR: relation "XXX" does not exist
Position: 22
Failed to connect and read from SQL database with connection_url: jdbc:postgresql://localhost:5432/...**
I am executing H2O with the follow command:
java -cp h2o.jar:/usr/share/java/postgresql-9.4.1212.jar water.H2OApp
The JDBC driver is installed and already try to construct the Connection URL in several ways.
I'm using this one right now:
jdbc:postgresql://localhost:5432/XXX?&useSSL=false

Liquibase - DB2 AS/400 - generateChangeLog throwing Exception "SYSCAT type *FILE not found"

I am trying to generate a Liquibase change log by running the command generateChangeLog, but I get the following error:
Starting Liquibase at Fri, 20 Apr 2018 14:26:14 GMT (version 3.6.1
built at 2018-04-11 08:41:04)
Unexpected error running Liquibase:
liquibase.exception.DatabaseException:
com.ibm.as400.access.AS400JDBCSQLSyntaxErrorException: [SQL0204]
REFERENCES in SYSCAT type *FILE not found.
liquibase.exception.LiquibaseException:
liquibase.command.CommandExecutionException:
liquibase.exception.DatabaseException:
liquibase.exception.DatabaseException:
com.ibm.as400.access.AS400JDBCSQLSyntaxErrorException: [SQL0204]
REFERENCES in SYSCAT type *FILE not found.
at
liquibase.integration.commandline.CommandLineUtils.doGenerateChangeLog
(CommandLineUtils.java:279)
at liquibase.integration.commandline.Main.doMigration(Main.java:1043)
at liquibase.integration.commandline.Main.run(Main.java:191)
at liquibase.integration.commandline.Main.main(Main.java:129)
My environment is:
DB2 UDB for AS/400 version 07.01.0000 V7R1m0
AS/400 Toolbox for Java JDBC Driver 10.2
liquibase 3.6.1
Java 8
Maven 3.3.3
syscat.references is not available on Db2 for i. Actually Db2 for i doesn't have a schema named SYSCAT at all.
qsys2.syscstdep seems to be the closest match...
INFORMATION_SCHEMA is the ANSI & ISO standard name for the DB catalog schema. On Db2 for i, it is an alias for QSYS2.
Edit
From the comment by #jmarkmurphy on the OP, it appears there's an Db2 for i Liquibase extension. I don't know for sure, but I'd suspect that installing that would redirect the query to the correct Db2 for i schema & table.