|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.midao.jdbc.core.AbstractQueryRunner
org.midao.jdbc.core.QueryRunner
public class QueryRunner
Base QueryRunnerService
implementation
Field Summary |
---|
Fields inherited from class org.midao.jdbc.core.AbstractQueryRunner |
---|
overrider |
Constructor Summary | |
---|---|
QueryRunner(java.sql.Connection conn)
Creates new QueryRunner instance |
|
QueryRunner(java.sql.Connection conn,
java.lang.Class<? extends TypeHandler> typeHandlerClazz)
Creates new QueryRunner instance |
|
QueryRunner(java.sql.Connection conn,
java.lang.Class<? extends TypeHandler> typeHandlerClazz,
java.lang.Class<? extends StatementHandler> statementHandlerClazz)
Creates new QueryRunner instance |
|
QueryRunner(javax.sql.DataSource ds)
Creates new QueryRunner instance |
|
QueryRunner(javax.sql.DataSource ds,
java.lang.Class<? extends TypeHandler> typeHandlerClazz)
Creates new QueryRunner instance |
|
QueryRunner(javax.sql.DataSource ds,
java.lang.Class<? extends TypeHandler> typeHandlerClazz,
java.lang.Class<? extends StatementHandler> statementHandlerClazz)
Creates new QueryRunner instance |
Method Summary | ||
---|---|---|
int[] |
batch(InputHandler[] inputHandlers)
Execute a batch of SQL INSERT, UPDATE, or DELETE queries. |
|
int[] |
batch(java.lang.String sql,
java.lang.Object[][] params)
Execute a batch of SQL INSERT, UPDATE, or DELETE queries. |
|
|
call(AbstractNamedInputHandler<T> inputHandler)
Executes the given CALL SQL statement. |
|
|
call(AbstractNamedInputHandler<T> inputHandler,
java.lang.String catalog,
java.lang.String schema,
boolean useCache)
Executes the given CALL SQL statement. |
|
QueryParameters |
call(AbstractQueryInputHandler inputHandler)
Executes the given CALL SQL statement. |
|
|
call(InputHandler<T> inputHandler,
OutputHandler<S> outputHandler)
Executes the given CALL SQL statement. |
|
|
call(InputHandler<T> inputHandler,
OutputHandler<S> outputHandler,
java.lang.String catalog,
java.lang.String schema,
boolean useCache)
Executes the given CALL SQL statement. |
|
|
query(InputHandler inputHandler,
OutputHandler<T> outputHandler)
Executes the given SELECT SQL query and returns a result object. |
|
|
query(java.lang.String sql,
OutputHandler<T> outputHandler)
Executes the given SELECT SQL without any replacement parameters. |
|
|
query(java.lang.String sql,
OutputHandler<T> outputHandler,
java.lang.Object... params)
Executes the given SELECT SQL query and returns a result object. |
|
int |
update(InputHandler inputHandler)
Executes the given INSERT, UPDATE, or DELETE SQL statement. |
|
|
update(InputHandler inputHandler,
OutputHandler<T> outputHandler)
Executes the given INSERT, UPDATE, or DELETE SQL statement. |
|
int |
update(java.lang.String sql)
Executes the given INSERT, UPDATE, or DELETE SQL statement without any replacement parameters. |
|
int |
update(java.lang.String sql,
java.lang.Object... params)
Executes the given INSERT, UPDATE, or DELETE SQL statement. |
|
int |
update(java.lang.String sql,
java.lang.Object param)
Executes the given INSERT, UPDATE, or DELETE SQL statement with a single replacement parameter. |
|
|
update(java.lang.String sql,
OutputHandler<T> outputHandler,
java.lang.Object... params)
Executes the given INSERT, UPDATE, or DELETE SQL statement. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public QueryRunner(javax.sql.DataSource ds)
ds
- SQL DataSourcepublic QueryRunner(java.sql.Connection conn)
conn
- SQL Connectionpublic QueryRunner(javax.sql.DataSource ds, java.lang.Class<? extends TypeHandler> typeHandlerClazz)
ds
- SQL DataSourcetypeHandlerClazz
- TypeHandler implementation class (from which new TypeHandler instance would be created)public QueryRunner(javax.sql.DataSource ds, java.lang.Class<? extends TypeHandler> typeHandlerClazz, java.lang.Class<? extends StatementHandler> statementHandlerClazz)
ds
- SQL DataSourcetypeHandlerClazz
- TypeHandler implementation class (from which new TypeHandler instance would be created)statementHandlerClazz
- StatementHandler implementation class (from which new TypeHandler instance would be created)public QueryRunner(java.sql.Connection conn, java.lang.Class<? extends TypeHandler> typeHandlerClazz)
conn
- SQL ConnectiontypeHandlerClazz
- TypeHandler implementation class (from which new TypeHandler instance would be created)public QueryRunner(java.sql.Connection conn, java.lang.Class<? extends TypeHandler> typeHandlerClazz, java.lang.Class<? extends StatementHandler> statementHandlerClazz)
conn
- SQL ConnectiontypeHandlerClazz
- TypeHandler implementation class (from which new TypeHandler instance would be created)statementHandlerClazz
- StatementHandler implementation class (from which new TypeHandler instance would be created)Method Detail |
---|
public int[] batch(java.lang.String sql, java.lang.Object[][] params) throws java.sql.SQLException
sql
- The SQL to execute.params
- An array of query replacement parameters. Each row in
this array is one set of batch replacement values.
java.sql.SQLException
- if exception would be thrown by Driver/Databasepublic int[] batch(InputHandler[] inputHandlers) throws java.sql.SQLException
inputHandlers
- Input Handler which would be executed
java.sql.SQLException
- if exception would be thrown by Driver/Databasepublic <T> T query(java.lang.String sql, OutputHandler<T> outputHandler, java.lang.Object... params) throws java.sql.SQLException
T
- The type of object that the handler returnssql
- The SQL statement to execute.outputHandler
- The handler used to create the result object from Query outputparams
- Initialize the PreparedStatement's IN parameters with this array.
java.sql.SQLException
- if exception would be thrown by Driver/Databasepublic <T> T query(InputHandler inputHandler, OutputHandler<T> outputHandler) throws java.sql.SQLException
T
- The type of object that the handler returnsinputHandler
- Input Handler which would be executedoutputHandler
- The handler used to create the result object from Query output
java.sql.SQLException
- if exception would be thrown by Driver/Databasepublic <T> T query(java.lang.String sql, OutputHandler<T> outputHandler) throws java.sql.SQLException
T
- The type of object that the handler returnssql
- The SQL statement to execute.outputHandler
- The handler used to create the result object from Query output
java.sql.SQLException
- if exception would be thrown by Driver/Databasepublic int update(java.lang.String sql) throws java.sql.SQLException
sql
- The SQL statement to execute.
java.sql.SQLException
- if exception would be thrown by Driver/Databasepublic int update(java.lang.String sql, java.lang.Object param) throws java.sql.SQLException
sql
- The SQL statement to execute.param
- The replacement parameter.
java.sql.SQLException
- if exception would be thrown by Driver/Databasepublic int update(java.lang.String sql, java.lang.Object... params) throws java.sql.SQLException
sql
- The SQL statement to execute.params
- Initializes the PreparedStatement's IN (i.e. '?') parameters.
java.sql.SQLException
- if exception would be thrown by Driver/Databasepublic int update(InputHandler inputHandler) throws java.sql.SQLException
inputHandler
- Input Handler which would be executed
java.sql.SQLException
- if exception would be thrown by Driver/Databasepublic <T> T update(InputHandler inputHandler, OutputHandler<T> outputHandler) throws java.sql.SQLException
T
- The type of object that the handler returnsinputHandler
- Input Handler which would be executedoutputHandler
- The handler used to create the result object from Query output
java.sql.SQLException
- if exception would be thrown by Driver/Databasepublic <T> T update(java.lang.String sql, OutputHandler<T> outputHandler, java.lang.Object... params) throws java.sql.SQLException
T
- The type of object that the handler returnssql
- The SQL statement to execute.outputHandler
- The handler used to create the result object from Query outputparams
- Initializes the PreparedStatement's IN (i.e. '?') parameters.
java.sql.SQLException
- if exception would be thrown by Driver/Databasepublic QueryParameters call(AbstractQueryInputHandler inputHandler) throws java.sql.SQLException
inputHandler
- Input Handler which would be executed
QueryParameters.getReturn()
java.sql.SQLException
- if exception would be thrown by Driver/Databasepublic <T> T call(AbstractNamedInputHandler<T> inputHandler, java.lang.String catalog, java.lang.String schema, boolean useCache) throws java.sql.SQLException
QueryRunnerService.call(org.midao.jdbc.core.handlers.input.query.AbstractQueryInputHandler)
as it is possible to specify Direction in QueryParameters class
T
- The type of object that the handler returnsinputHandler
- Input Handler which would be executedcatalog
- Database Catalog. If null would be specified - this value won't be used in searchschema
- Database Schema. If null would be specified - this value won't be used in searchuseCache
- specifies if it should use cache for reading Stored Procedure/Function parameters
java.sql.SQLException
- if exception would be thrown by Driver/Databasepublic <T> T call(AbstractNamedInputHandler<T> inputHandler) throws java.sql.SQLException
QueryRunnerService.call(org.midao.jdbc.core.handlers.input.query.AbstractQueryInputHandler)
as it is possible to specify Direction in QueryParameters class
T
- The type of object that the handler returnsinputHandler
- Input Handler which would be executed
java.sql.SQLException
- if exception would be thrown by Driver/Databasepublic <T,S> CallResults call(InputHandler<T> inputHandler, OutputHandler<S> outputHandler, java.lang.String catalog, java.lang.String schema, boolean useCache) throws java.sql.SQLException
QueryRunnerService.call(org.midao.jdbc.core.handlers.input.query.AbstractQueryInputHandler)
as it is possible to specify Direction in QueryParameters class
T
- The type of object that the input handler clones, updates and returnsS
- The type of object that the output handler returnsinputHandler
- Input Handler which would be executedoutputHandler
- The handler used to create the result object from Query outputcatalog
- Database Catalog. If null would be specified - this value won't be used in searchschema
- Database Schema. If null would be specified - this value won't be used in searchuseCache
- specifies if it should use cache for reading Stored Procedure/Function parameters
java.sql.SQLException
- if exception would be thrown by Driver/Databasepublic <T,S> CallResults call(InputHandler<T> inputHandler, OutputHandler<S> outputHandler) throws java.sql.SQLException
QueryRunnerService.call(org.midao.jdbc.core.handlers.input.query.AbstractQueryInputHandler)
as it is possible to specify Direction in QueryParameters class
T
- The type of object that the input handler clones, updates and returnsS
- The type of object that the output handler returnsinputHandler
- Input Handler which would be executedoutputHandler
- The handler used to create the result object from Query output
java.sql.SQLException
- if exception would be thrown by Driver/Database
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |