Package org.soulwing.jdbc
Interface JdbcOperations
-
- All Known Implementing Classes:
FluentJdbc
public interface JdbcOperationsA high level API for performing SQL operations using JDBC.The design of this interface was heavily influenced by the
FluentJdbcabstraction in the Spring Framework, however it differs significantly, particularly in the manner in which queries and updates are invoked. Nonetheless, users ofFluentJdbcshould find it familiar enough to easily learn.- Author:
- Carl Harris
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description JdbcCallcall(String sql)Creates a call operation.JdbcCallcall(SQLSource source)Creates a call operation.voidexecute(String sql)Executes a single SQL (DDL) statement.voidexecute(SQLSource source)Executes a single SQL (DDL) statement.voidexecuteScript(SQLSource source)Executes the sequence of SQL statements produced by the given source.JdbcQuery<Void>query()Creates a query operation.<T> JdbcQuery<T>queryForType(Class<T> type)Creates a query operation for objects of a given type.JdbcUpdateupdate()Creates an update operation.
-
-
-
Method Detail
-
execute
void execute(String sql)
Executes a single SQL (DDL) statement.- Parameters:
sql- the SQL statement to execute
-
execute
void execute(SQLSource source)
Executes a single SQL (DDL) statement.- Parameters:
source- source for the SQL statement to execute
-
executeScript
void executeScript(SQLSource source)
Executes the sequence of SQL statements produced by the given source.- Parameters:
source- source of the SQL statements to execute
-
query
JdbcQuery<Void> query()
Creates a query operation.This is a synonym for
queryForType(Class)withVoidas the specified type. A query obtained via this method is typically configured to use aResultSetHandlerto process returned rows.- Returns:
- query object that can be configured and executed to retrieve rows from the database
-
queryForType
<T> JdbcQuery<T> queryForType(Class<T> type)
Creates a query operation for objects of a given type.- Parameters:
type- subject type of the query- Returns:
- a query that can be configured and executed to retreive rows
from the database and return objects of type
T.
-
update
JdbcUpdate update()
Creates an update operation.- Returns:
- an updater that can be configured and executed to update rows in the database.
-
call
JdbcCall call(String sql)
Creates a call operation.- Parameters:
sql- SQL call statement- Returns:
- call operation
-
-