Java Doc for DataHandler.java in  » Testing » Marathon » com » ziclix » python » sql » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Testing » Marathon » com.ziclix.python.sql 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.ziclix.python.sql.DataHandler

All known Subclasses:   com.ziclix.python.sql.FilterDataHandler,
DataHandler
public class DataHandler (Code)
The DataHandler is responsible mapping the JDBC data type to a Jython 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.
author:
   brian zimmer
author:
   last revised by $Author: kzuberi $
version:
   $Revision: 2939 $



Constructor Summary
public  DataHandler()
     Handle most generic Java data types.

Method Summary
public  PyObject__chain__()
     Returns a list of datahandlers chained together through the use of delegation.
final public static  booleancheckNull(PreparedStatement stmt, int index, PyObject object, int type)
     Handles checking if the object is null or None and setting it on the statement.
public  StringgetMetaDataName(PyObject name)
     Some database vendors are case sensitive on calls to DatabaseMetaData, most notably Oracle.
public  ProceduregetProcedure(PyCursor cursor, PyObject name)
     A factory method for determing the correct procedure class to use per the cursor type.
public  PyObjectgetPyObject(ResultSet set, int col, int type)
     Given a ResultSet, column and type, return the appropriate Jython object.
public  PyObjectgetPyObject(CallableStatement stmt, int col, int type)
     Given a CallableStatement, column and type, return the appropriate Jython object.
public  PyObjectgetRowId(Statement stmt)
     Returns the row id of the last executed statement.
final public static  DataHandlergetSystemDataHandler()
     Build the DataHandler chain depending on the VM.
public  voidpostExecute(Statement stmt)
     A callback after successfully executing the statement.
public  voidpreExecute(Statement stmt)
     A callback prior to each execution of the statement.
final public static  byte[]read(InputStream stream)
     Since the driver needs to the know the length of all streams, read it into a byte[] array.
final public static  Stringread(Reader reader)
     Read all the chars from the Reader into the String.
public  voidregisterOut(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.
public  voidsetJDBCObject(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.
public  voidsetJDBCObject(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.
public  StringtoString()
     Returns the classname of this datahandler.


Constructor Detail
DataHandler
public DataHandler()(Code)
Handle most generic Java data types.




Method Detail
__chain__
public PyObject __chain__()(Code)
Returns a list of datahandlers chained together through the use of delegation. a list of datahandlers



checkNull
final public static boolean checkNull(PreparedStatement stmt, int index, PyObject object, int type) throws SQLException(Code)
Handles checking if the object is null or None and setting it on the statement. true if the object is null and was set on the statement, false otherwise



getMetaDataName
public String getMetaDataName(PyObject name)(Code)
Some database vendors are case sensitive on calls to DatabaseMetaData, most notably Oracle. This callback allows a DataHandler to affect the name.



getProcedure
public Procedure getProcedure(PyCursor cursor, PyObject name) throws SQLException(Code)
A factory method for determing the correct procedure class to use per the cursor type.
Parameters:
  cursor - an open cursor
Parameters:
  name - the name of the procedure to invoke an instance of a Procedure
throws:
  SQLException -



getPyObject
public PyObject getPyObject(ResultSet set, int col, int type) throws SQLException(Code)
Given a ResultSet, column and type, return the appropriate Jython object.

Note: DO NOT iterate the ResultSet.
Parameters:
  set - the current ResultSet set to the current row
Parameters:
  col - the column number (adjusted properly for JDBC)
Parameters:
  type - the column type
throws:
  SQLException - if the type is unmappable




getPyObject
public PyObject getPyObject(CallableStatement stmt, int col, int type) throws SQLException(Code)
Given a CallableStatement, column and type, return the appropriate Jython object.
Parameters:
  stmt - the CallableStatement
Parameters:
  col - the column number (adjusted properly for JDBC)
Parameters:
  type - the column type
throws:
  SQLException - if the type is unmappable



getRowId
public PyObject getRowId(Statement stmt) throws SQLException(Code)
Returns the row id of the last executed statement.
Parameters:
  stmt - the current statement the row id of the last executed statement or None
throws:
  SQLException - thrown if an exception occurs



getSystemDataHandler
final public static DataHandler getSystemDataHandler()(Code)
Build the DataHandler chain depending on the VM. This guarentees a DataHandler but might additionally chain a JDBC2.0 or JDBC3.0 implementation. a DataHandler configured for the VM version



postExecute
public void postExecute(Statement stmt) throws SQLException(Code)
A callback after successfully executing the statement.



preExecute
public void preExecute(Statement stmt) throws SQLException(Code)
A callback prior to each execution of the statement. If the statement is a PreparedStatement, all the parameters will have been set.



read
final public static byte[] read(InputStream stream)(Code)
Since the driver needs to the know the length of all streams, read it into a byte[] array. the stream as a byte[]



read
final public static String read(Reader reader)(Code)
Read all the chars from the Reader into the String. the contents of the Reader in a String



registerOut
public void registerOut(CallableStatement statement, int index, int colType, int dataType, String dataTypeName) throws SQLException(Code)
Called when a stored procedure or function is executed and OUT parameters need to be registered with the statement.
Parameters:
  statement -
Parameters:
  index - the JDBC offset column number
Parameters:
  colType - the column as from DatabaseMetaData (eg, procedureColumnOut)
Parameters:
  dataType - the JDBC datatype from Types
Parameters:
  dataTypeName - the JDBC datatype name
throws:
  SQLException -



setJDBCObject
public void setJDBCObject(PreparedStatement stmt, int index, PyObject object) throws SQLException(Code)
Any .execute() which uses prepared statements will receive a callback for deciding how to map the PyObject to the appropriate JDBC type.
Parameters:
  stmt - the current PreparedStatement
Parameters:
  index - the index for which this object is bound
Parameters:
  object - the PyObject in question
throws:
  SQLException -



setJDBCObject
public void setJDBCObject(PreparedStatement stmt, int index, PyObject object, int type) throws SQLException(Code)
Any .execute() which uses prepared statements will receive a callback for deciding how to map the PyObject to the appropriate JDBC type. The type is the JDBC type as obtained from java.sql.Types.
Parameters:
  stmt - the current PreparedStatement
Parameters:
  index - the index for which this object is bound
Parameters:
  object - the PyObject in question
Parameters:
  type - the java.sql.Types for which this PyObject should be bound
throws:
  SQLException -



toString
public String toString()(Code)
Returns the classname of this datahandler.



Methods inherited from java.lang.Object
protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object o)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
public int hashCode()(Code)(Java Doc)
final public void notify() throws IllegalMonitorStateException(Code)(Java Doc)
final public void notifyAll() throws IllegalMonitorStateException(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final public void wait() throws IllegalMonitorStateException, InterruptedException(Code)(Java Doc)
final public void wait(long ms) throws IllegalMonitorStateException, InterruptedException(Code)(Java Doc)
final public void wait(long ms, int ns) throws IllegalMonitorStateException, InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.