Package com.d3x.core.db
Class DatabaseExecute
- java.lang.Object
-
- com.d3x.core.db.DatabaseOperation<DatabaseExecute>
-
- com.d3x.core.db.DatabaseExecute
-
public class DatabaseExecute extends DatabaseOperation<DatabaseExecute>
A database operation to implement a JDBC Statement.execute() operation- Author:
- Xavier Witdouck
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceDatabaseExecute.MultipleAn interface to a handler that accepts multiple results setsstatic interfaceDatabaseExecute.SingleAn interface to a handler that accepts a single result set
-
Constructor Summary
Constructors Constructor Description DatabaseExecute(Database db, java.lang.String sql)Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description com.d3x.core.util.Option<java.lang.Integer>apply()Applies this database execute operationcom.d3x.core.util.Option<java.lang.Integer>apply(DatabaseExecute.Multiple handler)Applies this database execute operationcom.d3x.core.util.Option<java.lang.Integer>apply(DatabaseExecute.Single handler)Applies this database execute operation-
Methods inherited from class com.d3x.core.db.DatabaseOperation
args, fetchSize, getArgs, getDb, getFetchSize, getLimit, getSql, getTimeout, limit, sql, timeout
-
-
-
-
Constructor Detail
-
DatabaseExecute
DatabaseExecute(Database db, java.lang.String sql)
Constructor- Parameters:
db- the database referencesql- the sql for this operation
-
-
Method Detail
-
apply
public com.d3x.core.util.Option<java.lang.Integer> apply() throws DatabaseExceptionApplies this database execute operation- Returns:
- optional record count for operation
- Throws:
DatabaseException- if this operation fails
-
apply
public com.d3x.core.util.Option<java.lang.Integer> apply(DatabaseExecute.Single handler) throws DatabaseException
Applies this database execute operation- Returns:
- optional record count for operation
- Throws:
DatabaseException- if this operation fails
-
apply
public com.d3x.core.util.Option<java.lang.Integer> apply(DatabaseExecute.Multiple handler) throws DatabaseException
Applies this database execute operation- Parameters:
handler- the consumer to receive one or more result sets- Returns:
- the optional record count for operation
- Throws:
DatabaseException- if this operation fails
-
-