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
1
vote
0 answers

Hive string functions failing with VARCHAR but working with string

I am using jaydebeapi to connect to hive. I want to select the first 3 characters of a VARCHAR(100) using hive. I have columns named col1 and col2. col1 is a string and col2 is a VARCHAR(100) When I do this, it works fine: connection =…
1
vote
1 answer

Trying to pass variable from pandas to sql

I am trying to pass a simple variable (string, list whatever I can get working) in to sql (using jaydebapi to AWS Redshift cluster. The python/pandas code looks like this at moment. I think the %s is part of the problem: id = (261894) df =…
Kierk
  • 476
  • 6
  • 23
1
vote
1 answer

How to insert geography data to SQL Server with Python jaydebiapi cursor.executemany()?

I did insert data into SQL Server using cursor.execute(). Here is my code snippet: insert_str = """INSERT INTO [test].[DBO].[SPATIAL] VALUES({},{});""" geography = "geography::STGeomFromText('LINESTRING(-95.323167 29.985500, -95.323333 29.985500)',…
han
  • 103
  • 7
1
vote
1 answer

Python - Insert from select - Fom Pandas using cursor

I'm trying to insert records from my dataframe on a existing table that's stored on a Hive cluster. I cannot use sqlalchemy engine since I am using a JDBC connection. My code is: cursor = conn.cursor() engine = sqlalchemy.create_engine('driver://',…
user11756724
1
vote
0 answers

How do I use/create a db cursor in my python thread?

I'm getting threading errors when I try to use or create a db cursor in my process_id function. Each thread will have to use the database to process data for their passed id. I can't utilize a cursor in the thread/process_id at all(I get threading…
1
vote
1 answer

Hive JDBC Driver Python

I'm trying to connect to a Hive server with Jaydebeapi in python. But I don't know which jar file I need to add to etablish my connection. driver = 'org.apache.hive.jdbc.HiveDriver' url_path = 'jdbc:hive2://link:port/db' driver_arg ={'ssl':'*', …
LookingFor
  • 11
  • 1
  • 2
1
vote
1 answer

How to solve a "1st arg can't be coerced to String" for a jaydebeapi.connect command?

On Windows Server 2016, we are trying to connect over JDBC with a Jython script but our jaydebeapi.connect statement is giving the following error: TypeError: getConnection(): 1st arg can't be coerced to String Yet, when we look at examples of…
Praxiteles
  • 5,802
  • 9
  • 47
  • 78
1
vote
0 answers

Set JAVA_HOME in JayDeBeAPI on python

I want to connect to an Oracle database with JDBC and python. I have a Windows 7 machine. I have installed the jaydebeapi package. My Windows 7 machine has the 32bit JRE installed and installing the 64bit version is not an option. The actual Windows…
power
  • 1,680
  • 3
  • 18
  • 30
1
vote
1 answer

Error connection with JDBC to Oracle service name (jaydebeapi)

I try to make Oracle request in python from Raspberry pi. The problem is: "Oracle does not support the ARM CPU architecture which the Raspberry Pi uses. You downloaded and unzipped the Oracle Instant Client, but it can't actually run. And without…
Jeremy.l71
  • 45
  • 7
1
vote
1 answer

Airflow : Error while adding python dependency

I am trying to add jaydebeapi into Airflow (hosted on Google Cloud Composer) via Install pypi packages functionality. Below is the configuration: Airflow Version : 1.10.1 jaydebeapi version : 1.1.1 (tried with 0.2.0 as well) python version : 3 Once…
Darshan Mehta
  • 30,102
  • 11
  • 68
  • 102
1
vote
1 answer

Python jaydebeapi Class com.sybase.jdbc4.jdbc.SybDriver not found

I'm trying to connect to the IBM OMNIBUS objectserver DB using Jconn4 and jaydebeapi package, however I keep getting jpype._jexception.RuntimeExceptionPyRaisable: java.lang.RuntimeException: Class com.sybase.jdbc4.jdbc.SybDriver not found I've…
War_Archer
  • 21
  • 6
1
vote
0 answers

Formatting query parameters: jayDeBeApi and pandas.read_sql does not return results for queries with wildcard

I am trying to send a query to a Teradata Database through a python script using the jaydebapi package. I have had no issues pulling data in the past until I tried to use a wild card in a like statement SELECT .... FROM TABLE WHERE column LIKE…
Ian
  • 933
  • 12
  • 17
1
vote
0 answers

Class not found when importing redshift-fake-driver into python

I'm trying to connect to a Postgres DB using a the redshift-fake-driver (https://github.com/opt-tech/redshift-fake-driver) within my python code. However I can't get the driver to load. I'm running the python code within a docker container based on…
1
vote
1 answer

How can I connect to Postgres using JayDeBeApi? It doesn't find the org.postgresql.Driver

I have to connect to a DB2 to extract some data and create a Tableau Data Extract, in order to do this I wanted to use JayDeBeApi, and to test it I was trying to connect myself to a small Postgres database, but I can't establish a proper connection…
sgaseretto
  • 421
  • 5
  • 13
1
vote
2 answers

jaydebeapi Getting column alias names

Is there a way to return the aliased column names from a sql query returned from JayDeBeApi? For example, I have the following query: sql = """ SELECT visitorid AS id_alias FROM table LIMIT 1 """ I then run the following (connect_to_vdm()…
foobarbaz
  • 508
  • 1
  • 10
  • 27