org.sape.carbon.services.sql
Interface StatementFactory

All Superinterfaces:
FunctionalInterface
All Known Implementing Classes:
DefaultStatementFactoryImpl

public interface StatementFactory
extends FunctionalInterface

The SqlStatementFactory Interface is implemented by all statement factories.

Copyright 2002 Sapient

Since:
carbon 1.0
Version:
$Revision: 1.8 $($Author: dvoet $ / $Date: 2003/05/05 21:21:36 $)
Author:
Vivekanand Kirubanandan, June 2002

Method Summary
 CallableStatement createCallableStatement(String sqlQueryName)
          Creates a java.sql.CallableStatement based on the configuration.
 CallableStatement createCallableStatement(String sqlQueryName, Connection connection)
          Creates a java.sql.CallableStatement based on the configuration.
 PreparedStatement createPreparedStatement(String sqlQueryName)
          Creates a java.sql.PreparedStatement based on the configuration.
 PreparedStatement createPreparedStatement(String sqlQueryName, Connection connection)
          Creates a java.sql.PreparedStatement based on the configuration.
 

Method Detail

createPreparedStatement

public PreparedStatement createPreparedStatement(String sqlQueryName)
                                          throws StatementFactoryException

Creates a java.sql.PreparedStatement based on the configuration.

Parameters:
sqlQueryName - - Specifies the query name that would be looked up in the configuration.
Returns:
PreparedStatement an open configured Prepared Statement
Throws:
StatementFactoryException - when unable to create statement.

createPreparedStatement

public PreparedStatement createPreparedStatement(String sqlQueryName,
                                                 Connection connection)
                                          throws StatementFactoryException

Creates a java.sql.PreparedStatement based on the configuration.

Parameters:
sqlQueryName - - Specifies the query name that would be looked up in the configuration.
connection - - Specifies the connection to be used for creating the statement. Useful if we need to use the same connection for multiple queries.
Returns:
an open configured Prepared Statement
Throws:
StatementFactoryException - when unable to create statement.

createCallableStatement

public CallableStatement createCallableStatement(String sqlQueryName)
                                          throws StatementFactoryException

Creates a java.sql.CallableStatement based on the configuration.

Parameters:
sqlQueryName - - Specifies the query name that would be looked up in the configuration.
Returns:
CallableStatement an open configured Prepared Statement
Throws:
StatementFactoryException - when unable to create statement.

createCallableStatement

public CallableStatement createCallableStatement(String sqlQueryName,
                                                 Connection connection)
                                          throws StatementFactoryException

Creates a java.sql.CallableStatement based on the configuration.

Parameters:
sqlQueryName - - Specifies the query name that would be looked up in the configuration.
connection - - Specifies the connection to be used for creating the statement. Useful if we need to use the same connection for multiple queries.
Returns:
CallableStatement an open configured Prepared Statement
Throws:
StatementFactoryException - when unable to create statement.


Copyright 1999-2003 Sapient Corporation. All Rights Reserved.