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

Support JDBC driver for iSeries DB2 #930

Open
wants to merge 25 commits into
base: main
Choose a base branch
from
Open

Conversation

V3lop5
Copy link

@V3lop5 V3lop5 commented May 27, 2020

I found this framework recently and want to use it in combination with an iSeries / AS400 DB2 database.
Unfortunately, I couldn't get it to work with the required JDBC driver jt400.

What have I done?
I used the jt400 driver with Exposed Spring Starter. The error message Unsupported driver AS / 400 Toolbox for Java JDBC Driver detected appeared during the first transaction.

 <!-- https://mvnrepository.com/artifact/net.sf.jt400/jt400 -->
    <dependency>
      <groupId>net.sf.jt400</groupId>
      <artifactId>jt400-jdk8</artifactId>
      <version>10.3</version>
    </dependency>
    <!-- https://mvnrepository.com/artifact/org.jetbrains.exposed/exposed-spring-boot-starter -->
    <dependency>
      <groupId>org.jetbrains.exposed</groupId>
      <artifactId>exposed-spring-boot-starter</artifactId>
      <version>0.25.1</version>
    </dependency>

For this reason, I created a PULL request that supports the JDBC driver jt400 and at the same time adds the DB2 dialect.

Copy link
Contributor

@Tapac Tapac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please add db2 into TestDB to check that dialect works correctly?

@V3lop5
Copy link
Author

V3lop5 commented Jun 12, 2020

Hello Tapac,
thanks for your reply.

Currently I'm working on my bachelor thesis and running low on time.
I'll finish the tests later on.

@V3lop5 V3lop5 mentioned this pull request Jan 20, 2021
V3lop5 and others added 5 commits March 7, 2021 18:16
…/DB2.kt

Co-authored-by: Andrey.Tarashevskiy <fantocci@gmail.com>
# Conflicts:
#	exposed-core/src/main/kotlin/org/jetbrains/exposed/sql/Database.kt
a jdbc connection error needs somebody's attention
@V3lop5
Copy link
Author

V3lop5 commented May 2, 2021

I'm still alive! Currently I'm trying to get the db2 tests running.

There are two main versions of db2 out there: LUW and as400 (or called "i series" in modern references. But it's an ibm product so "modern" does not apply)
Originally my PR targeted the second one.
But testing the second one is really hard because you need such a midrange server.

So i decided to add LUW support to. The dialect is as far as i know the same. (But all system functions and tables are named differently for extra fun when searching/reading the docs.) The required jdbc driver can be found here (i guess).

Currently I ran into this jdbc connection problem. I tested multiple jdbc drivers but no one seems working out of the box.

I will pick up my work later on but for now i pushed my half working version of db2 tests. Maybe somebody finds a solution and can fix this. 🐧

@Tapac
Copy link
Contributor

Tapac commented May 12, 2021

@V3lop5 , I was able to run db2 tests but most of them fail. Please apply my patch and then try to fix them as I don't know the DB2 syntax.

@sola1tmy
Copy link

sola1tmy commented Mar 7, 2022

I'd like to add DB2 implementation based on the newly found db2 driver. However, this PR is exist now but hasn't been reviewed or merge for a long time. Shall I open a new PR or create a PR in @V3lop5 fork?

@V3lop5
Copy link
Author

V3lop5 commented Mar 13, 2022

Hi @sola1tmy, I'm still alive but got no time to finish my work here.

This PR is not merged due to failing tests.

@sola1tmy
Copy link

sola1tmy commented Mar 14, 2022

@V3lop5 So maybe I should create a pull request in your fork.
Now I'v fix some tests but there are still about 30 failed tests.Unluckily I won't have time to fix them this week.
Emm.Something more deserve to say is that a group_concat test failed seems to be a db2 bug, it may can't be fixed in exposed.

@sola1tmy
Copy link

And, the right driver should be com.ibm.db2:jcc:11.5.60

@V3lop5
Copy link
Author

V3lop5 commented Mar 14, 2022

@V3lop5 So maybe I should create a pull request in your fork. Now I'v fix some tests but there are still about 30 failed tests.Unluckily I won't have time to fix them this week. Emm.Something more deserve to say is that a group_concat test failed seems to be a db2 bug, it may can't be fixed in exposed.

Great! I missed your message and merged the JetBrains-master into my fork.
Hopefully that works for you?

And, the right driver should be com.ibm.db2:jcc:11.5.60

The latest version I see is 11.5.7.0.

Now you should noew be able to run db2 tests using ./gradlew db2Test in root folder.

Console output:

[...]
24 tests completed, 21 failed, 3 skipped

> Task :exposed-java-time:db2Test FAILED

FAILURE: Build failed with an exception.

I'm sorry for that many failing tests.
I originally created this PR with the intention to support data query language for DB2 AS/400. A frozen clone of my fork is still in use. I suppose.

I'll await your fixes and might be able to resolve the other failing tests next week.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants