|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.ibatis.jdbc.SqlRunner
public class SqlRunner
| Field Summary | |
|---|---|
static int |
NO_GENERATED_KEY
|
| Constructor Summary | |
|---|---|
SqlRunner(Connection connection)
|
|
| Method Summary | |
|---|---|
void |
closeConnection()
|
int |
delete(String sql,
Object... args)
Executes a DELETE statement. |
int |
insert(String sql,
Object... args)
Executes an INSERT statement. |
void |
run(String sql)
Executes any string as a JDBC Statement. |
List<Map<String,Object>> |
selectAll(String sql,
Object... args)
Executes a SELECT statement that returns multiple rows. |
Map<String,Object> |
selectOne(String sql,
Object... args)
Executes a SELECT statement that returns one row. |
void |
setUseGeneratedKeySupport(boolean useGeneratedKeySupport)
|
int |
update(String sql,
Object... args)
Executes an UPDATE statement. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int NO_GENERATED_KEY
| Constructor Detail |
|---|
public SqlRunner(Connection connection)
| Method Detail |
|---|
public void setUseGeneratedKeySupport(boolean useGeneratedKeySupport)
public Map<String,Object> selectOne(String sql,
Object... args)
throws SQLException
sql - The SQLargs - The arguments to be set on the statement.
SQLException - If more than one row is returned
public List<Map<String,Object>> selectAll(String sql,
Object... args)
throws SQLException
sql - The SQLargs - The arguments to be set on the statement.
SQLException - If statement prepration or execution fails
public int insert(String sql,
Object... args)
throws SQLException
sql - The SQLargs - The arguments to be set on the statement.
SQLException - If statement prepration or execution fails
public int update(String sql,
Object... args)
throws SQLException
sql - The SQLargs - The arguments to be set on the statement.
SQLException - If statement prepration or execution fails
public int delete(String sql,
Object... args)
throws SQLException
sql - The SQLargs - The arguments to be set on the statement.
SQLException - If statement prepration or execution fails
public void run(String sql)
throws SQLException
sql - The SQL
SQLException - If statement prepration or execution failspublic void closeConnection()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||