{"id":15041082,"url":"https://github.com/baztian/jaydebeapi","last_synced_at":"2025-05-15T05:05:26.862Z","repository":{"id":13889838,"uuid":"16588106","full_name":"baztian/jaydebeapi","owner":"baztian","description":"JayDeBeApi module allows you to connect from Python code to databases using Java JDBC. It provides a Python DB-API v2.0 to that database.","archived":false,"fork":false,"pushed_at":"2024-07-03T11:26:59.000Z","size":429,"stargazers_count":372,"open_issues_count":143,"forks_count":147,"subscribers_count":16,"default_branch":"master","last_synced_at":"2025-04-11T15:57:05.146Z","etag":null,"topics":["database","db","java","jdbc","python","python-2-7","python-3","sql"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/baztian.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2014-02-06T17:54:55.000Z","updated_at":"2025-03-31T14:28:04.000Z","dependencies_parsed_at":"2024-06-18T12:38:22.774Z","dependency_job_id":"9b749dd9-0b2a-4508-b2ec-8cf2c2a8407a","html_url":"https://github.com/baztian/jaydebeapi","commit_stats":{"total_commits":303,"total_committers":9,"mean_commits":"33.666666666666664","dds":0.06930693069306926,"last_synced_commit":"53b2d6a571aac5ea192b0b9d03f38ecc3f94e71d"},"previous_names":[],"tags_count":22,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/baztian%2Fjaydebeapi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/baztian%2Fjaydebeapi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/baztian%2Fjaydebeapi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/baztian%2Fjaydebeapi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/baztian","download_url":"https://codeload.github.com/baztian/jaydebeapi/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254276446,"owners_count":22043866,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["database","db","java","jdbc","python","python-2-7","python-3","sql"],"created_at":"2024-09-24T20:45:30.978Z","updated_at":"2025-05-15T05:05:26.839Z","avatar_url":"https://github.com/baztian.png","language":"Python","readme":"=================================================================\n JayDeBeApi - bridge from JDBC database drivers to Python DB-API\n=================================================================\n\n.. image:: https://github.com/baztian/jaydebeapi/workflows/tests/badge.svg\n   :target: https://github.com/baztian/jaydebeapi/actions?query=workflow%3Atests\n   :alt: test status\n\n.. image:: https://img.shields.io/coveralls/baztian/jaydebeapi/master.svg\n    :target: https://coveralls.io/r/baztian/jaydebeapi\n\n.. image:: https://img.shields.io/badge/python-2.7,_3.5,_3.6,_3.8-blue.svg\n    :target: https://pypi.python.org/pypi/JayDeBeApi/\n\n.. image:: https://img.shields.io/badge/jython-2.7.2-blue.svg\n    :target: https://pypi.python.org/pypi/JayDeBeApi/\n\n.. image:: https://img.shields.io/github/tag/baztian/jaydebeapi.svg\n    :target: https://pypi.python.org/pypi/JayDeBeApi/\n\n.. image:: https://img.shields.io/pypi/dm/JayDeBeApi.svg\n    :target: https://pypi.python.org/pypi/JayDeBeApi/\n\nThe JayDeBeApi module allows you to connect from Python code to\ndatabases using Java `JDBC\n\u003chttp://java.sun.com/products/jdbc/overview.html\u003e`_. It provides a\nPython DB-API_ v2.0 to that database.\n\nIt works on ordinary Python (cPython) using the JPype_ Java\nintegration or on `Jython \u003chttp://www.jython.org/\u003e`_ to make use of\nthe Java JDBC driver.\n\nIn contrast to zxJDBC from the Jython project JayDeBeApi let's you\naccess a database with Jython AND Python with only minor code\nmodifications. JayDeBeApi's future goal is to provide a unique and\nfast interface to different types of JDBC-Drivers through a flexible\nplug-in mechanism.\n\n.. contents::\n\nInstall\n=======\n\nYou can get and install JayDeBeApi with `pip \u003chttp://pip.pypa.io/\u003e`_ ::\n\n    $ pip install JayDeBeApi\n\nIf you want to install JayDeBeApi in Jython make sure to have pip or\nEasyInstall available for it.\n\nOr you can get a copy of the source by cloning from the `JayDeBeApi\ngithub project \u003chttps://github.com/baztian/jaydebeapi\u003e`_ and install\nwith ::\n\n    $ python setup.py install\n\nor if you are using Jython use ::\n\n    $ jython setup.py install\n\nIt has been tested with Jython 2.7.2.\n\nIf you are using cPython ensure that you have installed JPype_\nproperly. It has been tested with JPype1 0.6.3 and 0.7.5 for Python 3 and\nwith JPype1 0.6.3 and 0.7.0 for Python 2.7. Older JPype\ninstallations may cause problems.\n\nUsage\n=====\n\nBasically you just import the ``jaydebeapi`` Python module and execute\nthe ``connect`` method. This gives you a DB-API_ conform connection to\nthe database.\n\nThe first argument to ``connect`` is the name of the Java driver\nclass. The second argument is a string with the JDBC connection\nURL. Third you can optionally supply a sequence consisting of user and\npassword or alternatively a dictionary containing arguments that are\ninternally passed as properties to the Java\n``DriverManager.getConnection`` method. See the Javadoc of\n``DriverManager`` class for details.\n\nThe next parameter to ``connect`` is optional as well and specifies\nthe jar-Files of the driver if your classpath isn't set up\nsufficiently yet. The classpath set in ``CLASSPATH`` environment\nvariable will be honored. See the documentation of your Java runtime\nenvironment.\n\nHere is an example:\n\n\u003e\u003e\u003e import jaydebeapi\n\u003e\u003e\u003e conn = jaydebeapi.connect(\"org.hsqldb.jdbcDriver\",\n...                           \"jdbc:hsqldb:mem:.\",\n...                           [\"SA\", \"\"],\n...                           \"/path/to/hsqldb.jar\",)\n\u003e\u003e\u003e curs = conn.cursor()\n\u003e\u003e\u003e curs.execute('create table CUSTOMER'\n...              '(\"CUST_ID\" INTEGER not null,'\n...              ' \"NAME\" VARCHAR(50) not null,'\n...              ' primary key (\"CUST_ID\"))'\n...             )\n\u003e\u003e\u003e curs.execute(\"insert into CUSTOMER values (?, ?)\", (1, 'John'))\n\u003e\u003e\u003e curs.execute(\"select * from CUSTOMER\")\n\u003e\u003e\u003e curs.fetchall()\n[(1, u'John')]\n\u003e\u003e\u003e curs.close()\n\u003e\u003e\u003e conn.close()\n\nIf you're having trouble getting this work check if your ``JAVA_HOME``\nenvironment variable is set correctly. For example I have to set it on\nmy Ubuntu machine like this ::\n\n    $ JAVA_HOME=/usr/lib/jvm/java-8-openjdk python\n\nAn alternative way to establish connection using connection\nproperties:\n\n\u003e\u003e\u003e conn = jaydebeapi.connect(\"org.hsqldb.jdbcDriver\",\n...                           \"jdbc:hsqldb:mem:.\",\n...                           {'user': \"SA\", 'password': \"\",\n...                            'other_property': \"foobar\"},\n...                           \"/path/to/hsqldb.jar\",)\n\nAlso using the ``with`` statement might be handy:\n\n\u003e\u003e\u003e with jaydebeapi.connect(\"org.hsqldb.jdbcDriver\",\n...                         \"jdbc:hsqldb:mem:.\",\n...                         [\"SA\", \"\"],\n...                         \"/path/to/hsqldb.jar\",) as conn:\n...     with conn.cursor() as curs:\n...         curs.execute(\"select count(*) from CUSTOMER\")\n...         curs.fetchall()\n[(1,)]\n\nSupported databases\n===================\n\nIn theory *every database with a suitable JDBC driver should work*. It\nis confirmed to work with the following databases:\n\n* SQLite\n* Hypersonic SQL (HSQLDB)\n* IBM DB2\n* IBM DB2 for mainframes\n* Oracle\n* Teradata DB\n* Netezza\n* Mimer DB\n* Microsoft SQL Server\n* MySQL\n* PostgreSQL\n* many more...\n\nContributing\n============\n\nPlease submit `bugs and patches\n\u003chttps://github.com/baztian/jaydebeapi/issues\u003e`_. All contributors\nwill be acknowledged. Thanks!\n\nLicense\n=======\n\nJayDeBeApi is released under the GNU Lesser General Public license\n(LGPL). See the file ``COPYING`` and ``COPYING.LESSER`` in the\ndistribution for details.\n\n\nChangelog\n=========\n\n- Next version - unreleased\n- 1.2.3 - 2020-06-12\n\n  - Make pip install for Python 2 work by changing JPype1 requirement to older\n    version\n  - Make pip install for Jython work by removing JPype1 requirement for Jython\n  - Removed cursor destructor to avoid issues with some JPype versions (please\n    make sure you're always closing your cursors properly)\n\n- 1.2.2 - 2020-06-04\n\n  - Return (big) decimal types as long value if scale is zero (thanks\n    to @ministat)\n  - Fix `DECIMAL` and `NUMERIC` type conversion for Jython\n\n- 1.2.1 - 2020-05-27\n\n  - Increased thread safety. Should resolve some of the\n    `No suitable driver found` errors (thanks to @thealmightygrant)\n\n- 1.2.0 - 2020-05-22\n\n  - Added compatibility to JPype1 0.7.2+ (thanks to @dpd)\n  - Support `with` statement (thanks to @Szczepanov)\n\n- 1.1.2 - 2019-09-02\n\n  - Added compatibility to JPype1 0.7 (thanks to @Iverian, @Thrameos)\n  - Dropped python 2.6 support\n  - Fix build working with newer Maven versions\n  - Accidently force-pushed to master branch. Sorry for that.\n    \n- 1.1.1 - 2017-03-21\n\n  - Don't fail on dates before 1900 on Python \u003c 3.\n\n- 1.1.0 - 2017-03-19\n\n  - Support BIT and TINYINT type mappings (thanks @Mokubyow for\n    reporting the issue).\n\n- 1.0.0 - 2017-01-10\n\n  - Allow for db properties to be passed to the connect\n    method. *Probably incompatible to code based on previous\n    versions.* See documentation of the connect method. (Thanks\n    @testlnord for you efforts and the patience.)\n\n  - New major version due to possible api incompatibility.\n\n- 0.2.0 - 2015-04-26\n\n  - Python 3 support (requires JPype1 \u003e= 0.6.0).\n\n- 0.1.6 - 2015-04-10\n\n  - Fix Jython handling of Java exceptions that don't subclass python Exception\n\n  - Enrich exceptions with message from java SQLExceptions\n\n  - Be more specific about DB API exceptions: Distinguish DatabaseError and\n    InterfaceError.\n\n  - Fix typo LONGNARCHAR vs LONGVARCHAR (thanks @datdo for reporting #4)\n\n- 0.1.5 - 2015-03-02\n\n  - Add version number to module.\n\n  - Improve robustness of java to python type conversion.\n\n  - Support Time type.\n\n  - Add DB-API compliant exception handling.\n\n  - Minor documentation improvements.\n\n  - Some development related changes (Host project at github, use\n    Travis CI, use JPype1 for tests).\n\n- 0.1.4 - 2013-10-29\n\n  - More convenient way to setup Java classpath. *Important note*\n    check the changes to the ``connect`` method and adapt your code.\n\n  - Honor ``CLASSPATH`` if used in JPype mode.\n\n  - Set ``.rowcount`` properly.\n\n  - Changed signature of ``.setoutputsize()`` to be DB-API compliant.\n\n- 0.1.3 - 2011-01-27\n\n  - Fixed DB-API_ violation: Use ``curs.execute('foo ?', (bar, baz))``\n    instead of ``curs.execute('foo ?', bar, baz)``.\n\n  - Free resources after ``executemany`` call.\n\n  - Improved type handling. Initial support for BLOB columns.\n\n- 0.1.2 - 2011-01-25\n\n  - ``easy_install JayDeBeApi`` should really work.\n\n- 0.1.1 - 2010-12-12\n\n  - Fixed bug #688290 \"NULL values with converters error on fetch\".\n  - Fixed bug #684909 \"Selecting ROWIDs errors out on fetch\".\n\n- 0.1 - 2010-08-10\n\n  - Initial release.\n\nTo do\n=====\n\n- Extract Java calls to separate Java methods to increase performance.\n- Check if https://code.launchpad.net/dbapi-compliance can help making\n  JayDeBeApi more DB-API compliant.\n- Test it on different databases and provide a flexible db specific\n  pluign mechanism.\n- SQLAlchemy modules (separate project)\n\n.. _DB-API: http://www.python.org/dev/peps/pep-0249/\n.. _JPype: https://pypi.python.org/pypi/JPype1/\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbaztian%2Fjaydebeapi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbaztian%2Fjaydebeapi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbaztian%2Fjaydebeapi/lists"}