Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend DB2 JDBC extension to cover AS400 for native #11395

Open
vaughnmb opened this issue Aug 14, 2020 · 8 comments
Open

Extend DB2 JDBC extension to cover AS400 for native #11395

vaughnmb opened this issue Aug 14, 2020 · 8 comments
Labels
area/jdbc Issues related to the JDBC extensions kind/enhancement New feature or request

Comments

@vaughnmb
Copy link

Description
Extend DB2 JDBC extension to cover AS400 for native. Currently, it doesn't appear to work as I get this error while running the application.

java.sql.SQLException: Driver does not support the provided URL: jdbc:as400

@vaughnmb vaughnmb added the kind/enhancement New feature or request label Aug 14, 2020
@quarkusbot
Copy link

/cc @aguibert

@quarkusbot quarkusbot added the area/persistence OBSOLETE, DO NOT USE label Aug 14, 2020
@aguibert
Copy link
Member

hi @vaughnmb, I have not worked with the DB2 on AS400/native driver much, but AFAIK it is a completely separate driver right? Currently the DB2 JDBC extension only works for the DB2 JCC (Universal) driver, which starts with the jdbc:db2: URL protocol.

Is it possible for you to use the jdbc:db2: URL protocol instead? It should work for connecting to any DB2 platform (LUW, z/OS, or AS400)

@vaughnmb
Copy link
Author

@aguibert I changed the url to be jdbc:db2: and I got this...

Caused by: com.ibm.db2.jcc.am.SqlSyntaxErrorException: [jcc]Missing resource bundle: A resource bundle could not be found in the com.ibm.db2.jcc package for IBM Data Server Driver for JDBC and SQLJ ERRORCODE=-4461, SQLSTATE=42815
at com.ibm.db2.jcc.am.b7.a(b7.java:810)
at com.ibm.db2.jcc.am.b7.a(b7.java:66)
at com.ibm.db2.jcc.am.b7.a(b7.java:116)
at com.ibm.db2.jcc.DB2Driver.connect(DB2Driver.java:414)
at com.ibm.db2.jcc.DB2Driver.connect(DB2Driver.java:116)
at io.agroal.pool.ConnectionFactory.createConnection(ConnectionFactory.java:200)
at io.agroal.pool.ConnectionPool$CreateConnectionTask.call(ConnectionPool.java:419)
at io.agroal.pool.ConnectionPool$CreateConnectionTask.call(ConnectionPool.java:401)
at java.util.concurrent.FutureTask.run(FutureTask.java:264)
at io.agroal.pool.util.PriorityScheduledExecutor.beforeExecute(PriorityScheduledExecutor.java:65)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1126)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.lang.Thread.run(Thread.java:834)

@aguibert
Copy link
Member

@vaughnmb is this error from running Quarkus in JVM mode or Native-image mode?

@vaughnmb
Copy link
Author

@aguibert Native-image mode

@aguibert
Copy link
Member

ok, can you try in JVM mode to see if that works? If it works fine in JVM mode but doesn't work in native mode, then we can transition this issue to a bug and get it fixed for native mode

@vaughnmb
Copy link
Author

vaughnmb commented Aug 14, 2020

Here is the error I got when I tried to run it in locally JVM mode "mvn quarkus:dev"

Caused by: com.ibm.db2.jcc.am.DisconnectNonTransientConnectionException: [jcc][t4][2057][11264][4.27.25] The application server rejected establishment of the connection.
An attempt was made to access a database, "Database-Name", which was either not found or does not support transactions. ERRORCODE=-4499, SQLSTATE=08004
at com.ibm.db2.jcc.am.b7.a(b7.java:338)
at com.ibm.db2.jcc.am.b7.a(b7.java:463)
at com.ibm.db2.jcc.t4.z.u(z.java:1946)
at com.ibm.db2.jcc.t4.z.o(z.java:696)
at com.ibm.db2.jcc.t4.z.k(z.java:491)
at com.ibm.db2.jcc.t4.z.c(z.java:144)
at com.ibm.db2.jcc.t4.b.k(b.java:1497)
at com.ibm.db2.jcc.t4.b.b(b.java:1410)
at com.ibm.db2.jcc.t4.b.a(b.java:6804)
at com.ibm.db2.jcc.t4.b.b(b.java:931)
at com.ibm.db2.jcc.t4.b.a(b.java:844)
at com.ibm.db2.jcc.t4.b.a(b.java:443)
at com.ibm.db2.jcc.t4.b.a(b.java:416)
at com.ibm.db2.jcc.t4.b.(b.java:354)
at com.ibm.db2.jcc.DB2SimpleDataSource.getConnection(DB2SimpleDataSource.java:233)
at com.ibm.db2.jcc.DB2SimpleDataSource.getConnection(DB2SimpleDataSource.java:200)
at com.ibm.db2.jcc.DB2Driver.connect(DB2Driver.java:474)
at com.ibm.db2.jcc.DB2Driver.connect(DB2Driver.java:116)
at io.agroal.pool.ConnectionFactory.createConnection(ConnectionFactory.java:200)
at io.agroal.pool.ConnectionPool$CreateConnectionTask.call(ConnectionPool.java:419)
at io.agroal.pool.ConnectionPool$CreateConnectionTask.call(ConnectionPool.java:401)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at io.agroal.pool.util.PriorityScheduledExecutor.beforeExecute(PriorityScheduledExecutor.java:65)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630)
at java.base/java.lang.Thread.run(Thread.java:832)

@aguibert
Copy link
Member

So that error is a different ERRORCODE and SQLSTATE from before, and it indicates the database was not found. Try double checking your configuration by seeing if you can write a standalone Java + JDBC program that gets a connection to the database with the same DB2 JDBC driver and the same credentials/settings.

@yrodiere yrodiere added area/jdbc Issues related to the JDBC extensions and removed area/persistence OBSOLETE, DO NOT USE labels Aug 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/jdbc Issues related to the JDBC extensions kind/enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants