public interface StatementHolder
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes the underlying Statement and Connection if this StatementHolder is
not pooled.
|
int |
executeUpdate(String sql)
Executes the given SQL statement.
|
int |
executeUpdate(String sql,
boolean ignoreException)
Executes the given SQL statement.
|
void |
forceClose()
Closes the underlying Statement and Connection disregarding whether this
StatementHolder is not pooled or not.
|
Connection |
getConnection()
Returns the wrapped Connection.
|
Statement |
getStatement()
Returns the wrapped Statement.
|
boolean |
isPooled()
Method indicating whether the wrapped Connection is pooled.
|
Double |
queryForDouble(String sql)
Executes the given SQL statement and returns the first column of the first
row in the resulting ResultSet as a Double.
|
Integer |
queryForInteger(String sql)
Executes the given SQL statement and returns the first column of the first
row in the resulting ResultSet as an Integer.
|
String |
queryForString(String sql)
Executes the given SQL statement and returns the first column of the first
row in the resulting ResultSet as a String.
|
int |
update(String sql)
Executes a INSERT, UPDATE or DELETE SQL statement or an SQL statement that
returns nothing.
|
Statement getStatement()
Connection getConnection()
int executeUpdate(String sql)
sql - the SQL statement.RuntimeException - if an exception occurs.int executeUpdate(String sql, boolean ignoreException)
sql - the SQL statement.ignoreException - indicates whether to skip closing the underlying
connection if an exception occurs.RuntimeException - if an exception occurs.Integer queryForInteger(String sql)
sql - the SQL statementDouble queryForDouble(String sql)
sql - the SQL statementString queryForString(String sql)
sql - the SQL statementint update(String sql)
sql - the SQL statement to execute.boolean isPooled()
void close()
void forceClose()
Copyright © 2016 UiO. All rights reserved.