Top Description Fields Constructors Methods
com.ziclix.python.sql.handler

public Class UpdateCountDataHandler

extends FilterDataHandler
Class Inheritance
Imports
com.ziclix.python.sql.DataHandler, .FilterDataHandler, .zxJDBC, org.python.core.Py, java.sql.SQLException, .Statement

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 where clause. Therefore, to assure the correct update count is returned, either include a where clause, or understand that the value will always be 0.

Author
brian zimmer
See Also
java.sql.Statement#getUpdateCount()

Field Summary

Modifier and TypeField and Description
private static boolean
public int
updateCount

The update count for the last executed statement.

Constructor Summary

AccessConstructor and Description
public
UpdateCountDataHandler(DataHandler datahandler)

Handle capturing the update count.

Method Summary

Modifier and TypeMethod and Description
public void
postExecute(Statement stmt)

Overrides com.ziclix.python.sql.FilterDataHandler.postExecute.

Gets the update count from the statement after successfully executing.

public void
preExecute(Statement stmt)

Overrides com.ziclix.python.sql.FilterDataHandler.preExecute.

Sets the update count to -1 prior to the statement being executed.

Inherited from com.ziclix.python.sql.FilterDataHandler:
__chain__getPyObjectgetRowIdsetJDBCObjectsetJDBCObject

Field Detail

onceback to summary
private static boolean once
updateCountback to summary
public int updateCount

The update count for the last executed statement.

Constructor Detail

UpdateCountDataHandlerback to summary
public UpdateCountDataHandler(DataHandler datahandler)

Handle capturing the update count. The initial value of the updateCount is -1.

Method Detail

postExecuteback to summary
public void postExecute(Statement stmt) throws SQLException

Overrides com.ziclix.python.sql.FilterDataHandler.postExecute.

Gets the update count from the statement after successfully executing.

preExecuteback to summary
public void preExecute(Statement stmt) throws SQLException

Overrides com.ziclix.python.sql.FilterDataHandler.preExecute.

Sets the update count to -1 prior to the statement being executed.