com.ziclix.python.sql
Interface DataHandler

All Known Implementing Classes:
DefaultDataHandler, InformixDataHandler

public interface DataHandler

The DataHandler is responsible mapping the JDBC data type to a JPython object. Depending on the version of the JDBC implementation and the particulars of the driver, the type mapping can be significantly different. This interface can also be used to change the behaviour of the default mappings provided by the cursor. This might be useful in handling more complicated data types such as BLOBs, CLOBs and Arrays.

Version:
$Revision: 1.5 $
Author:
brian zimmer, last revised by $Author: bzimmer $

Method Summary
 org.python.core.PyObject getPyObject(java.sql.ResultSet set, int col, int type)
          Given a ResultSet, column and type, return the appropriate JPython object.
 void setJDBCObject(java.sql.PreparedStatement stmt, int index, org.python.core.PyObject object)
          $METHOD_DESCRIPTION$
 void setJDBCObject(java.sql.PreparedStatement stmt, int index, org.python.core.PyObject object, int type)
          $METHOD_DESCRIPTION$
 

Method Detail

getPyObject

public org.python.core.PyObject getPyObject(java.sql.ResultSet set,
                                            int col,
                                            int type)
                                     throws java.sql.SQLException
Given a ResultSet, column and type, return the appropriate JPython object.

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:
java.sql.SQLException - if the type is unmappable

setJDBCObject

public void setJDBCObject(java.sql.PreparedStatement stmt,
                          int index,
                          org.python.core.PyObject object)
                   throws java.sql.SQLException
$METHOD_DESCRIPTION$
Parameters:
stmt -  
index -  
object -  
Throws:
java.sql.SQLException -  

setJDBCObject

public void setJDBCObject(java.sql.PreparedStatement stmt,
                          int index,
                          org.python.core.PyObject object,
                          int type)
                   throws java.sql.SQLException
$METHOD_DESCRIPTION$
Parameters:
stmt -  
index -  
object -  
type -  
Throws:
java.sql.SQLException -  


Copyright (c) 2000 brian zimmer. All Rights Reserved.