PHP 8.0.30
Preview: zxjdbc.py Size: 1.38 KB
/opt/alt/python37/lib64/python3.7/site-packages/sqlalchemy/dialects/postgresql/zxjdbc.py

# postgresql/zxjdbc.py
# Copyright (C) 2005-2019 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php

"""
.. dialect:: postgresql+zxjdbc
    :name: zxJDBC for Jython
    :dbapi: zxjdbc
    :connectstring: postgresql+zxjdbc://scott:tiger@localhost/db
    :driverurl: http://jdbc.postgresql.org/


"""
from .base import PGDialect
from .base import PGExecutionContext
from ...connectors.zxJDBC import ZxJDBCConnector


class PGExecutionContext_zxjdbc(PGExecutionContext):
    def create_cursor(self):
        cursor = self._dbapi_connection.cursor()
        cursor.datahandler = self.dialect.DataHandler(cursor.datahandler)
        return cursor


class PGDialect_zxjdbc(ZxJDBCConnector, PGDialect):
    jdbc_db_name = "postgresql"
    jdbc_driver_name = "org.postgresql.Driver"

    execution_ctx_cls = PGExecutionContext_zxjdbc

    supports_native_decimal = True

    def __init__(self, *args, **kwargs):
        super(PGDialect_zxjdbc, self).__init__(*args, **kwargs)
        from com.ziclix.python.sql.handler import PostgresqlDataHandler

        self.DataHandler = PostgresqlDataHandler

    def _get_server_version_info(self, connection):
        parts = connection.connection.dbversion.split(".")
        return tuple(int(x) for x in parts)


dialect = PGDialect_zxjdbc

Directory Contents

Dirs: 1 × Files: 14

Name Size Perms Modified Actions
- drwxr-xr-x 2023-12-06 03:19:26
Edit Download
10.83 KB lrw-r--r-- 2019-07-21 20:36:19
Edit Download
116.34 KB lrw-r--r-- 2019-07-21 20:36:19
Edit Download
7.40 KB lrw-r--r-- 2019-07-21 20:36:19
Edit Download
6.66 KB lrw-r--r-- 2019-07-21 20:36:19
Edit Download
12.22 KB lrw-r--r-- 2019-07-21 20:36:19
Edit Download
9.71 KB lrw-r--r-- 2019-07-21 20:36:19
Edit Download
9.49 KB lrw-r--r-- 2019-07-21 20:36:19
Edit Download
29.56 KB lrw-r--r-- 2019-07-21 20:36:19
Edit Download
1.62 KB lrw-r--r-- 2019-07-21 20:36:19
Edit Download
7.94 KB lrw-r--r-- 2019-07-21 20:36:19
Edit Download
2.85 KB lrw-r--r-- 2019-07-21 20:36:19
Edit Download
4.64 KB lrw-r--r-- 2019-07-21 20:36:19
Edit Download
1.38 KB lrw-r--r-- 2019-07-21 20:36:19
Edit Download
2.40 KB lrw-r--r-- 2019-07-21 20:36:19
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).