com.ziclix.python.sql
public class DataHandler extends Object
Version: $Revision: 3484 $
Constructor Summary | |
---|---|
DataHandler()
Handle most generic Java data types. |
Method Summary | |
---|---|
static boolean | checkNull(PreparedStatement stmt, int index, PyObject object, int type)
Handles checking if the object is null or None and setting it on the statement.
|
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(ResultSet set, int col, int type)
Given a ResultSet, column and type, return the appropriate
Jython object.
|
PyObject | getPyObject(CallableStatement stmt, int col, int type)
Given a CallableStatement, column and type, return the appropriate
Jython object.
|
PyObject | getRowId(Statement stmt)
Returns the row id of the last executed statement.
|
static DataHandler | getSystemDataHandler()
Build the DataHandler chain depending on the VM. |
void | postExecute(Statement stmt)
A callback after successfully executing the statement. |
void | preExecute(Statement stmt)
A callback prior to each execution of the statement. |
static byte[] | read(InputStream stream)
Since the driver needs to the know the length of all streams,
read it into a byte[] array.
|
static String | read(Reader reader)
Read all the chars from the Reader into the String.
|
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. |
String | toString()
Returns the classname of this datahandler. |
PyObject | __chain__()
Returns a list of datahandlers chained together through the use of delegation.
|
Returns: true if the object is null and was set on the statement, false otherwise
Parameters: cursor an open cursor name the name of the procedure to invoke
Returns: an instance of a Procedure
Throws: SQLException
Note: DO NOT iterate the ResultSet.
Parameters: set the current ResultSet set to the current row col the column number (adjusted properly for JDBC) type the column type
Throws: SQLException if the type is unmappable
Parameters: stmt the CallableStatement col the column number (adjusted properly for JDBC) type the column type
Throws: SQLException if the type is unmappable
Parameters: stmt the current statement
Returns: the row id of the last executed statement or None
Throws: SQLException thrown if an exception occurs
Returns: a DataHandler configured for the VM version
Returns: the stream as a byte[]
Returns: the contents of the Reader in a String
Parameters: statement index the JDBC offset column number colType the column as from DatabaseMetaData (eg, procedureColumnOut) dataType the JDBC datatype from Types dataTypeName the JDBC datatype name
Throws: SQLException
Parameters: stmt the current PreparedStatement index the index for which this object is bound object the PyObject in question
Throws: SQLException
Parameters: stmt the current PreparedStatement index the index for which this object is bound object the PyObject in question type the java.sql.Types for which this PyObject should be bound
Throws: SQLException
Returns: a list of datahandlers