org.mule.module.db.internal.domain.autogeneratedkey
Interface AutoGeneratedKeyStrategy

All Known Implementing Classes:
ColumnIndexAutoGeneratedKeyStrategy, ColumnNameAutoGeneratedKeyStrategy, DefaultAutoGeneratedKeyStrategy, NoAutoGeneratedKeyStrategy

public interface AutoGeneratedKeyStrategy

Manages different ways to process auto generated keys


Method Summary
 boolean execute(Statement statement, QueryTemplate queryTemplate)
          Executes a query that can return multiple results
 int executeUpdate(Statement statement, QueryTemplate queryTemplate)
          Executes an update query
 PreparedStatement prepareStatement(DbConnection connection, QueryTemplate queryTemplate)
          Prepares a statement in order to return auto generated keys
 boolean returnsAutoGeneratedKeys()
          Indicates if there are auto generated keys to return
 

Method Detail

returnsAutoGeneratedKeys

boolean returnsAutoGeneratedKeys()
Indicates if there are auto generated keys to return

Returns:
true if there are auto generated keys, false otherwise

prepareStatement

PreparedStatement prepareStatement(DbConnection connection,
                                   QueryTemplate queryTemplate)
                                   throws SQLException
Prepares a statement in order to return auto generated keys

Parameters:
connection - connection uses to prepare the statement
queryTemplate - query template to be prepared
Returns:
a statement prepared to return auto generated keys
Throws:
SQLException - if there is any error preparing the query

execute

boolean execute(Statement statement,
                QueryTemplate queryTemplate)
                throws SQLException
Executes a query that can return multiple results

Parameters:
statement - statement to be executed
queryTemplate - query to execute
Returns:
true if the first result is a ResultSet object; false if it is an update count or there are no results
Throws:
SQLException - if there is any database error or this method is called on a closed Statement

executeUpdate

int executeUpdate(Statement statement,
                  QueryTemplate queryTemplate)
                  throws SQLException
Executes an update query

Parameters:
statement - statement to be executed
queryTemplate - query to execute
Returns:
true if the first result is a ResultSet object; false if it is an update count or there are no results
Throws:
SQLException - if there is any database error or this method is called on a closed Statement


Copyright © 2003–2014 MuleSoft, Inc.. All rights reserved.