com.bowstreet.builders.webapp.methods
Interface SqlStatement


public interface SqlStatement

Interface for all builder helper classes that implement runtime functionality to create and prepare a JDBC Statement for execution. WebApp Variables that have this interface are automatically discovered by the SQL Transaction builder and become choices for the "Statement Name" input of the transaction steps.

Version:
1.0 9/17/02
Author:
David Gawron

Method Summary
 java.sql.PreparedStatement createStatement(WebAppAccess webAppAccess, java.sql.Connection connection)
          Method used to create and prepare a JDBC Statement for execution.
 java.sql.PreparedStatement createStatement(WebAppAccess webAppAccess, java.sql.Connection connection, java.util.Map invokeParameters)
          Method used to create and prepare a JDBC Statement for execution.
 java.sql.PreparedStatement createStatement(WebAppAccess webAppAccess, java.sql.Connection connection, java.util.Map invokeParameters, java.lang.String sortColumn, boolean sortAscending)
          Method used to create and prepare a JDBC Statement for execution and apply a dynamic column sort to the result set.
 java.sql.PreparedStatement createStatement(WebAppAccess webAppAccess, java.sql.Connection connection, java.lang.String sortColumn, boolean sortAscending)
          Method used to create and prepare a JDBC Statement for execution and apply a dynamic column sort to the result set.
 IXml getMetaData()
          Method used to fetch XML metadata that describes the statement's parameters and describes the methods to be used to transform OUT parameters and columns in the statement's result set, if any.
 void initialize(WebAppAccess webAppAccess)
          Method used to initialize the helper class with the current set of values for the indirect references that were used to define the builder's inputs.
 

Method Detail

createStatement

java.sql.PreparedStatement createStatement(WebAppAccess webAppAccess,
                                           java.sql.Connection connection)
Method used to create and prepare a JDBC Statement for execution. The values used to bind the positional input parameters are those defined in the builder inputs by the user.

Parameters:
webAppAccess - The WebApp instance for the request.
connection - The JDBC connection on which to create and prepare the SQL statement. If a valid statement cannot be prepared for this request, then a WebAppRuntimeException will be thrown with a message that indicates why a statement was not prepared.
Returns:
A JDBC PreparedStatement that is ready for execution. Note that a CallableStatement (derived from PreparedStatement) will be returned if the SqlStatement instance is configured to prepare a stored procedure call.

createStatement

java.sql.PreparedStatement createStatement(WebAppAccess webAppAccess,
                                           java.sql.Connection connection,
                                           java.util.Map invokeParameters)
Method used to create and prepare a JDBC Statement for execution. The values used to bind the positional input parameters are those defined in the builder inputs by the user and those provided by the caller of this method. If a parameter value is defined in both places (in the builder inputs and via this method's arguments), then the value provided by this method call takes precedence.

Parameters:
webAppAccess - The WebApp instance for the request.
connection - The JDBC connection on which to create and prepare the SQL statement. If a valid statement cannot be prepared for this request, then a WebAppRuntimeException will be thrown with a message that indicates why a statement was not prepared.
invokeParameters - SQL statement parameter values to be used in place of parameter bindings defined in the builder inputs at design-time. The map keys are the parameter positions for which new values are being supplied. The values of the map are the actual values to be used to bind input paramters of the SQL statement. If the map is null or empty, then the original parameter bindings are used in total.
Returns:
A JDBC PreparedStatement that is ready for execution. Note that a CallableStatement (derived from PreparedStatement) will be returned if the SqlStatement instance is configured to prepare a stored procedure call.

createStatement

java.sql.PreparedStatement createStatement(WebAppAccess webAppAccess,
                                           java.sql.Connection connection,
                                           java.util.Map invokeParameters,
                                           java.lang.String sortColumn,
                                           boolean sortAscending)
Method used to create and prepare a JDBC Statement for execution and apply a dynamic column sort to the result set. The values used to bind the positional input parameters are those defined in the builder inputs by the user and those provided by the caller of this method. If a parameter value is defined in both places (in the builder inputs and via this method's arguments), then the value provided by this method call takes precedence. This method will throw an exception if the SQL statement to be executed is anything other than a SELECT.

Parameters:
webAppAccess - The WebApp instance for the request.
connection - The JDBC connection on which to create and prepare the SQL statement. If a valid statement cannot be prepared for this request, then a WebAppRuntimeException will be thrown with a message that indicates why a statement was not prepared.
sortColumn - Name of the result set column on which to apply a dynamic sort. An exception will be thrown if this column name is not present in the result set generated by the SELECT statement. If the column name is NULL or blank, then the dynamic sort will be omitted.
sortAscending - TRUE causes the dynamic sort to be ascending on the named column. FALSE applies a descending sort.
invokeParameters - SQL statement parameter values to be used in place of parameter bindings defined in the builder inputs at design-time. The map keys are the parameter positions for which new values are being supplied. The values of the map are the actual values to be used to bind input paramters of the SQL statement. If the map is null or empty, then the original parameter bindings are used in total.
Returns:
A JDBC PreparedStatement that is ready for execution. Note that a CallableStatement (derived from PreparedStatement) will be returned if the SqlStatement instance is configured to prepare a stored procedure call.

createStatement

java.sql.PreparedStatement createStatement(WebAppAccess webAppAccess,
                                           java.sql.Connection connection,
                                           java.lang.String sortColumn,
                                           boolean sortAscending)
Method used to create and prepare a JDBC Statement for execution and apply a dynamic column sort to the result set. The values used to bind the positional input parameters are those defined in the builder inputs by the user. This method will throw an exception if the SQL statement to be executed is anything other than a SELECT.

Parameters:
webAppAccess - The WebApp instance for the request.
connection - The JDBC connection on which to create and prepare the SQL statement. If a valid statement cannot be prepared for this request, then a WebAppRuntimeException will be thrown with a message that indicates why a statement was not prepared.
sortColumn - Name of the result set column on which to apply a dynamic sort. An exception will be thrown if this column name is not present in the result set generated by the SELECT statement. If the column name is NULL or blank, then the dynamic sort will be omitted.
sortAscending - TRUE causes the dynamic sort to be ascending on the named column. FALSE applies a descending sort.
Returns:
A JDBC PreparedStatement that is ready for execution. Note that a CallableStatement (derived from PreparedStatement) will be returned if the SqlStatement instance is configured to prepare a stored procedure call.

getMetaData

IXml getMetaData()
Method used to fetch XML metadata that describes the statement's parameters and describes the methods to be used to transform OUT parameters and columns in the statement's result set, if any.

Returns:
Returns an XML instance that contains the metadata describing the last JDBC Statement that was created and prepared by a call to either createStatement() method.

initialize

void initialize(WebAppAccess webAppAccess)
Method used to initialize the helper class with the current set of values for the indirect references that were used to define the builder's inputs.

Parameters:
webAppAccess - The web app access instance for the request. If NULL, the the class will re-initialize itself with the values it already has.


Copyright © 2009 IBM. All Rights Reserved.