Questions tagged [jaydebeapi]

A bridge from JDBC database drivers to Python DB-API.

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.

In contrast to zxJDBC from the Jython project, JayDeBeApi let's you access a database with Jython AND Python with only minor code modifications. JayDeBeApi's future goal is to provide a unique and fast interface to different types of JDBC-Drivers through a flexible plug-in mechanism.

For more information, visit the JayDeBeApi homepage

146 questions
11
votes
2 answers

Connect Python to H2

I'm trying to make a connection from python2.7 to H2 (h2-1.4.193.jar - latest) H2 (is running and available): java -Dh2.bindAddress=127.0.0.1 -cp "E:\Dir\h2-1.4.193.jar;%H2DRIVERS%;%CLASSPATH%" org.h2.tools.Server -tcpPort 15081 -baseDir…
IgorZ
  • 1,125
  • 3
  • 20
  • 44
4
votes
1 answer

jaydebeapi under pytest leaking environment variable content in logs

I am connecting to a db using jaydebeapi and a jdbc driver using the following snippet, that works fine when the all parameters are correctly specified. I am storing my credentials in environment variables e.g. os.environ.get('credentials') import…
00__00__00
  • 4,834
  • 9
  • 41
  • 89
4
votes
2 answers

Error in installing JPype1 in Python 3.7 on Mac OS 10.14.2

I am getting error while installing JPype1 in my system. I am using Python 3.7. JPype1 is required as dependency for Jaydebeapi. pip install Jpype1 Following are the error message: Collecting jpype1 Using cached …
user10860718
4
votes
1 answer

Connect to DB2 via JayDeBeApi JDBC in Python

I've been struggling for a while to connect to DB2 via Python client on OSX (maveriks). A valid option seem to be using JayDeBeApi but, running the following code... import jaydebeapi import jpype jar = '/opt/IBM/db2/V10.1/java/db2jcc4.jar' #…
Alessandro Mariani
  • 1,181
  • 2
  • 10
  • 26
3
votes
1 answer

Class org.apache.hive.jdbc.HiveDriver not found

I am trying to access hive from my local machine using hivejdbc driver. but i am facing issues. i am using below code. not sure how to add jar to python. import jaydebeapi url = ("jdbc:hive2://" + "" + ":" + str(10000) + "/"+ "db"…
LUZO
  • 1,019
  • 4
  • 19
  • 42
3
votes
2 answers

JayDeBeApi triggers java.sql.SQLException: No suitable driver found

I'm trying to connect to a Teradata database in Python 3 using the package JayDeBeApi. This is part of an API project using Flask and Flask-Restplus Here is a minimal working example to reproduce the issue. In a terminal Window, type the following…
Alexis.Rolland
  • 5,724
  • 6
  • 50
  • 77
3
votes
1 answer

Driver not found connecting to oracle DB with jaydebeapi

Trying to connect to a db but getting error: conn = jaydebeapi.connect('oracle.jdbc.driver.OracleDriver', jdbc:oracle:thin:@mydomain.com:1234:GP1', [ 'user', 'pass'], …
dreab
  • 705
  • 3
  • 12
  • 22
3
votes
1 answer

jaydebeapi set autocommit off for bulk inserts

I have many rows to insert into a table and tried doing row by row but it is taking a really long time. i read this link Python+MySQL - Bulk Insert and seems like setting autocommit to be off can speed things up. import jadebeapi connection =…
jxn
  • 7,685
  • 28
  • 90
  • 172
3
votes
2 answers

Python > Connection with JDBC to Oracle service name (jaydebeapi)

This sample code is used to connect in Python to Oracle SID. import jpype import jaydebeapi jHome = jpype.getDefaultJVMPath() jpype.startJVM(jHome, '-Djava.class.path=/path/to/ojdbc6.jar') conn =…
Yuriy Brovko
  • 81
  • 1
  • 2
  • 7
3
votes
2 answers

jaydebeapi teradata connection

I am trying to connect to teradata database using jaydebeapi package. conn = jaydebeapi.connect('com.teradata.jdbc.TeraDriver', ['jdbc:teradata://ip/TMODE=ANSI,CHARSET=utf8', 'username', 'password'], …
Abhi
  • 73
  • 1
  • 6
3
votes
3 answers

Python SQL Query Performance

I am using jaydebeapi (Mac OS X) to query a Netezza database and performing some quick/dirty timing: t0 = time.time() curs.execute('''select * from table1;''') print time.time() - t0 I created the table myself and it contains 650,000 rows and 9…
slaw
  • 6,591
  • 16
  • 56
  • 109
3
votes
3 answers

JPype and JayDeBeAPI returns jpype._jclass.java.lang.Long

I'm using JayDeBeAPI in PySpark (the Apache Spark Python API), and here's the beginning of my code (note, I'm actually running all this through an interactive shell with PySpark). import jaydebeapi import jpype conn =…
Alaa Ali
  • 896
  • 1
  • 12
  • 24
3
votes
1 answer

Get column names using jaydebeapi

How can i do the following in jaydebeapi ? #In Java ResultSet rs = stmt.executeQuery("SELECT a, b, c FROM TABLE2"); ResultSetMetaData rsmd = rs.getMetaData(); String columnName = rsmd.getColumnName(0) ## basically i am interested with this part
whb
  • 661
  • 2
  • 10
  • 22
3
votes
2 answers

Using JPype - How can I access JDBC Meta Data Functions

I'm using JayDeBeAPI which uses JPype to load FileMaker's JDBC driver and pull data. But I also want to be able to get a listing of all tables in the database. In the JDBC documentation (page 55) it lists the following functions: The JDBC client…
Greg
  • 45,306
  • 89
  • 231
  • 297
2
votes
1 answer

Storing MySQL binary(16) with JayDeBeApi

I need to store a UUID as binary(16) in MySQL using JayDeBeApi, which uses JDBC under the hood. When I try to save the data using Python bytes, the data is not converted/or stored correctly. When using one parameter curs.execute('INSERT INTO `user`…
Paul Samsotha
  • 205,037
  • 37
  • 486
  • 720
1
2 3
9 10