public class Jython22DataHandler extends DataHandler
Constructor and Description |
---|
Jython22DataHandler()
Handle most generic Java data types.
|
Modifier and Type | Method and Description |
---|---|
PyObject |
__chain__()
Returns a list of datahandlers chained together through the use of delegation.
|
String |
getMetaDataName(PyObject name)
Some database vendors are case sensitive on calls to DatabaseMetaData,
most notably Oracle.
|
Procedure |
getProcedure(PyCursor cursor,
PyObject name)
A factory method for determing the correct procedure class to use
per the cursor type.
|
PyObject |
getPyObject(CallableStatement stmt,
int col,
int type)
Given a CallableStatement, column and type, return the appropriate
Jython object.
|
PyObject |
getPyObject(ResultSet set,
int col,
int type)
Given a ResultSet, column and type, return the appropriate
Jython object.
|
PyObject |
getRowId(Statement stmt)
Returns the row id of the last executed statement.
|
void |
postExecute(Statement stmt)
A callback after successfully executing the statement.
|
void |
preExecute(Statement stmt)
A callback prior to each execution of the statement.
|
void |
registerOut(CallableStatement statement,
int index,
int colType,
int dataType,
String dataTypeName)
Called when a stored procedure or function is executed and OUT parameters
need to be registered with the statement.
|
void |
setJDBCObject(PreparedStatement stmt,
int index,
PyObject object)
Any .execute() which uses prepared statements will receive a callback for deciding
how to map the PyObject to the appropriate JDBC type.
|
void |
setJDBCObject(PreparedStatement stmt,
int index,
PyObject object,
int type)
Any .execute() which uses prepared statements will receive a callback for deciding
how to map the PyObject to the appropriate JDBC type.
|
checkNull, getSystemDataHandler, read, read, toString
public Jython22DataHandler()
public String getMetaDataName(PyObject name)
getMetaDataName
in class DataHandler
public Procedure getProcedure(PyCursor cursor, PyObject name) throws SQLException
getProcedure
in class DataHandler
cursor
- an open cursorname
- the name of the procedure to invokeSQLException
public PyObject getRowId(Statement stmt) throws SQLException
getRowId
in class DataHandler
stmt
- the current statementSQLException
- thrown if an exception occurspublic void preExecute(Statement stmt) throws SQLException
preExecute
in class DataHandler
SQLException
public void postExecute(Statement stmt) throws SQLException
postExecute
in class DataHandler
SQLException
public void setJDBCObject(PreparedStatement stmt, int index, PyObject object) throws SQLException
setJDBCObject
in class DataHandler
stmt
- the current PreparedStatementindex
- the index for which this object is boundobject
- the PyObject in questionSQLException
public void setJDBCObject(PreparedStatement stmt, int index, PyObject object, int type) throws SQLException
setJDBCObject
in class DataHandler
stmt
- the current PreparedStatementindex
- the index for which this object is boundobject
- the PyObject in questiontype
- the java.sql.Types for which this PyObject should be boundSQLException
public PyObject getPyObject(ResultSet set, int col, int type) throws SQLException
Note: DO NOT iterate the ResultSet.
getPyObject
in class DataHandler
set
- the current ResultSet set to the current rowcol
- the column number (adjusted properly for JDBC)type
- the column typeSQLException
- if the type is unmappablepublic PyObject getPyObject(CallableStatement stmt, int col, int type) throws SQLException
getPyObject
in class DataHandler
stmt
- the CallableStatementcol
- the column number (adjusted properly for JDBC)type
- the column typeSQLException
- if the type is unmappablepublic void registerOut(CallableStatement statement, int index, int colType, int dataType, String dataTypeName) throws SQLException
registerOut
in class DataHandler
statement
- index
- the JDBC offset column numbercolType
- the column as from DatabaseMetaData (eg, procedureColumnOut)dataType
- the JDBC datatype from TypesdataTypeName
- the JDBC datatype nameSQLException
public PyObject __chain__()
__chain__
in class DataHandler