Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Python 3 - Connecting with JDBC

How do you connect to a database using a JDBC driver from within Python 3? JayDeBeApi seems to do the job for Python 2, but at the moment it isn't Python 3-compatible.

This question is similar to this one, but I am asking specifically about Python 3.

like image 669
aparkerlue Avatar asked Oct 13 '11 23:10

aparkerlue


People also ask

Can Python connect to JDBC?

The 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. It works on ordinary Python (cPython) using the JPype Java integration or on Jython to make use of the Java JDBC driver.

Does SQLAlchemy use JDBC?

It is surprised to know SQLAlchemy does not have direct JDBC support and JayDeBeAPI does not have a dialect after 3 years. Not mean to complain.

What is JDBC vs ODBC?

ODBC is an SQL-based Application Programming Interface (API) created by Microsoft that is used by Windows software applications to access databases via SQL. JDBC is an SQL-based API created by Sun Microsystems to enable Java applications to use SQL for database access.


2 Answers

As I can not delete this answer, I will edit it:

Way back when, I created a Python3-port of JayDeBeApi. But as the other answer points out, the official JayDeBeApi now supports Python3 as well.

like image 132
nuts Avatar answered Sep 21 '22 10:09

nuts


Starting from version 0.2 the official JayDeBeApi now supports Python 3 as well. It is still backwards compatible with Python 2 and Jython.

like image 33
bastian Avatar answered Sep 19 '22 10:09

bastian