Description
When calling cursor.execute() with Python datetime.datetime or datetime.date objects as parameters, JPype raises No matching overloads found for setObject because it cannot automatically convert Python datetime types to java.sql.Timestamp or java.sql.Date.
This affects stored procedure calls and parameterized queries that pass datetime values.
Steps to Reproduce
import jaydebeapi
conn = jaydebeapi.connect(driver_class, jdbc_url, [user, pass], jars)
cursor = conn.cursor()
cursor.execute("{call sp_UpsertTS(?,?,?,?,?,?)}", (id, datetime_obj, end_time, userid, pairid, username))
# RuntimeError: No matching overloads found for setObject
Expected Behavior
Python datetime.datetime should be automatically converted to java.sql.Timestamp, and datetime.date to java.sql.Date before being passed to PreparedStatement.setObject().
Legacy Reference
baztian/jaydebeapi#70
Description
When calling
cursor.execute()with Pythondatetime.datetimeordatetime.dateobjects as parameters, JPype raisesNo matching overloads found for setObjectbecause it cannot automatically convert Python datetime types tojava.sql.Timestamporjava.sql.Date.This affects stored procedure calls and parameterized queries that pass datetime values.
Steps to Reproduce
Expected Behavior
Python
datetime.datetimeshould be automatically converted tojava.sql.Timestamp, anddatetime.datetojava.sql.Datebefore being passed toPreparedStatement.setObject().Legacy Reference
baztian/jaydebeapi#70