com.ziclix.python.sql.handler
Class UpdateCountDataHandler
- java.lang.Object
-
- com.ziclix.python.sql.DataHandler
-
- com.ziclix.python.sql.FilterDataHandler
-
- com.ziclix.python.sql.handler.UpdateCountDataHandler
-
public class UpdateCountDataHandler extends FilterDataHandler
A data handler that keeps track of the update count for each execution of a Statement.Note: MySql does not return the correct count for a delete statement that has no
whereclause. Therefore, to assure the correct update count is returned, either include awhereclause, or understand that the value will always be0.- See Also:
Statement.getUpdateCount()
-
-
Field Summary
Fields Modifier and Type Field and Description intupdateCountThe update count for the last executed statement.
-
Constructor Summary
Constructors Constructor and Description UpdateCountDataHandler(DataHandler datahandler)Handle capturing the update count.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidpostExecute(java.sql.Statement stmt)Gets the update count from the statement after successfully executing.voidpreExecute(java.sql.Statement stmt)Sets the update count to-1prior to the statement being executed.-
Methods inherited from class com.ziclix.python.sql.FilterDataHandler
__chain__, getPyObject, getRowId, setJDBCObject, setJDBCObject
-
Methods inherited from class com.ziclix.python.sql.DataHandler
checkNull, getMetaDataName, getProcedure, getPyObject, getSystemDataHandler, read, read, registerOut, toString
-
-
-
-
Constructor Detail
-
UpdateCountDataHandler
public UpdateCountDataHandler(DataHandler datahandler)
Handle capturing the update count. The initial value of the updateCount is-1.
-
-
Method Detail
-
preExecute
public void preExecute(java.sql.Statement stmt) throws java.sql.SQLExceptionSets the update count to-1prior to the statement being executed.- Overrides:
preExecutein classFilterDataHandler- Throws:
java.sql.SQLException
-
postExecute
public void postExecute(java.sql.Statement stmt) throws java.sql.SQLExceptionGets the update count from the statement after successfully executing.- Overrides:
postExecutein classFilterDataHandler- Throws:
java.sql.SQLException
-
-
DataMelt 3.0 © DataMelt by jWork.ORG