Skip to content

Remove the zxJDBC dialect and its entry points - #204

Merged
bimalkjha merged 1 commit into
ibmdb:masterfrom
aminghadersohi:remove-zxjdbc-dialect
Oct 3, 2026
Merged

bimalkjha merged 1 commit into
ibmdb:masterfrom
aminghadersohi:remove-zxjdbc-dialect

Conversation

@aminghadersohi

Copy link
Copy Markdown
Contributor

Problem

ibm_db_sa/zxjdbc.py imports sqlalchemy.connectors.zxJDBC, which SQLAlchemy removed in 1.4. This package declares four sqlalchemy.dialects entry points that point at it:

  • db2.zxjdbc, db2.zxjdbc400
  • ibm_db_sa.zxjdbc, ibm_db_sa.zxjdbc400

On any supported SQLAlchemy 1.4 or 2.0 install, loading them always raises ModuleNotFoundError: No module named 'sqlalchemy.connectors.zxJDBC'. The dialect also only ever worked on Jython, and Jython cannot install this package (python_requires >= 3.9), so it can't be used even with SQLAlchemy 1.3.

Applications that enumerate installed dialects through entry points, for example to show which databases are available, hit and log this error on every scan.

Change

  • Remove ibm_db_sa/zxjdbc.py and its four entry points.
  • Remove the two zxjdbc registrations from run_tests.py.
  • README: known limitation 7 now mentions PyODBC only.

The ibm_db, pyodbc and AS/400 dialects, and all their entry points, are unchanged.

Verification

Python 3.11, SQLAlchemy 2.0.52. The script loads every sqlalchemy.dialects entry point this distribution declares:

Build Loaded Failed
master 7f3866e (0.4.4) 8 4 (all four zxjdbc: No module named 'sqlalchemy.connectors.zxJDBC')
this branch 8 0

The same four failures reproduce with released 0.4.0 on SQLAlchemy 1.4.54. The built wheel's entry_points.txt lists exactly the eight remaining dialects, and the wheel contains no zxjdbc module.

ibm_db_sa/zxjdbc.py imports sqlalchemy.connectors.zxJDBC, which SQLAlchemy
removed in 1.4, and the dialect itself only runs on Jython, which cannot
install this package (python_requires >= 3.9). The four sqlalchemy.dialects
entry points that point at it therefore always fail to load with
ModuleNotFoundError. Applications that enumerate installed dialects through
entry points (for example to list available databases) hit and log that
error on every scan.

Drop the module, its four entry points and the matching test registrations.
The ibm_db, pyodbc and AS/400 dialects are unchanged.

Signed-off-by: Amin Ghadersohi <amin.ghadersohi@gmail.com>
@bchoudhary6415

Copy link
Copy Markdown
Collaborator

Hi @bimalkjha ,

This PR looks correct and ready to merge.

As noted in the SQLAlchemy documentation, support for Jython/zxJDBC was removed upstream because it was no longer functional or supported. Since ibm_db_sa still exposes zxJDBC entry points that depend on removed SQLAlchemy code, removing those dead entry points and the unused dialect implementation is the right change.

Reference from SQLAlchemy:
[platform] [removed]

Removed all dialect code related to support for Jython and zxJDBC. Jython has not been supported by SQLAlchemy for many years and it is not expected that the current zxJDBC code is at all functional; for the moment it just takes up space and adds confusion by showing up in documentation. At the moment, it appears that Jython has achieved Python 2.7 support in its releases but not Python 3. If Jython were to be supported again, the form it should take is against the Python 3 version of Jython, and the various zxJDBC stubs for various backends should be implemented as a third party dialect.

References: #5094

Please merge this PR.

Thank you!

@bimalkjha
bimalkjha merged commit f4a8894 into ibmdb:master Oct 3, 2026
3 checks passed
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.

3 participants