|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--groovy.gdo.Sql
Represents an extent of objects
Field Summary | |
protected Logger |
log
|
Constructor Summary | |
Sql(DataSource dataSource)
|
Method Summary | |
protected String |
asSql(groovy.lang.GString gstring)
|
int |
call(groovy.lang.GString gstring)
Performs a stored procedure call with the given parameters |
int |
call(String sql)
Performs a stored procedure call |
int |
call(String sql,
List params)
Performs a stored procedure call with the given parameters |
protected void |
closeResources(Connection connection,
Statement statement)
|
protected void |
closeResources(Connection connection,
Statement statement,
ResultSet results)
|
protected Connection |
createConnection()
|
groovy.gdo.DataSet |
dataSet(String table)
|
boolean |
execute(groovy.lang.GString gstring)
Executes the given SQL with embedded expressions inside |
boolean |
execute(String sql)
Executes the given piece of SQL |
boolean |
execute(String sql,
List params)
Executes the given piece of SQL with parameters |
DataSource |
getDataSource()
|
protected List |
getParameters(groovy.lang.GString gstring)
|
void |
query(groovy.lang.GString gstring,
groovy.lang.Closure closure)
Performs the given SQL query calling the closure with the result set |
void |
query(String sql,
groovy.lang.Closure closure)
Performs the given SQL query calling the closure with the result set |
void |
query(String sql,
List params,
groovy.lang.Closure closure)
Performs the given SQL query with parameters calling the closure with the result set |
void |
queryEach(groovy.lang.GString gstring,
groovy.lang.Closure closure)
Performs the given SQL query calling the closure with the result set |
void |
queryEach(String sql,
groovy.lang.Closure closure)
Performs the given SQL query calling the closure with each row of the result set |
void |
queryEach(String sql,
List params,
groovy.lang.Closure closure)
Performs the given SQL query calling the closure with the result set |
protected void |
setObject(PreparedStatement statement,
int i,
Object value)
Strategy method allowing derived classes to handle types differently such as for CLOBs etc. |
protected void |
setParameters(List params,
PreparedStatement statement)
Appends the parameters to the given statement |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected Logger log
Constructor Detail |
public Sql(DataSource dataSource)
Method Detail |
public groovy.gdo.DataSet dataSet(String table)
public void query(String sql, groovy.lang.Closure closure) throws SQLException
SQLException
public void query(String sql, List params, groovy.lang.Closure closure) throws SQLException
SQLException
public void query(groovy.lang.GString gstring, groovy.lang.Closure closure) throws SQLException
SQLException
public void queryEach(String sql, groovy.lang.Closure closure) throws SQLException
SQLException
public void queryEach(String sql, List params, groovy.lang.Closure closure) throws SQLException
SQLException
public void queryEach(groovy.lang.GString gstring, groovy.lang.Closure closure) throws SQLException
SQLException
public boolean execute(String sql) throws SQLException
SQLException
public boolean execute(String sql, List params) throws SQLException
SQLException
public boolean execute(groovy.lang.GString gstring) throws SQLException
SQLException
public int call(String sql) throws Exception
Exception
public int call(String sql, List params) throws Exception
Exception
public int call(groovy.lang.GString gstring) throws Exception
Exception
public DataSource getDataSource()
protected String asSql(groovy.lang.GString gstring)
protected List getParameters(groovy.lang.GString gstring)
protected void setParameters(List params, PreparedStatement statement) throws SQLException
SQLException
protected void setObject(PreparedStatement statement, int i, Object value) throws SQLException
SQLException
protected Connection createConnection() throws SQLException
SQLException
protected void closeResources(Connection connection, Statement statement, ResultSet results)
protected void closeResources(Connection connection, Statement statement)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |