|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.deegree.commons.utils.JDBCUtils
public final class JDBCUtils
This class contains static utility methods for working with JDBC.
Constructor Summary | |
---|---|
JDBCUtils()
|
Method Summary | |
---|---|
static void |
close(Connection conn)
Close the object, suppress all errors/exceptions. |
static void |
close(ResultSet resultSet)
Close the object, suppress all errors/exceptions. |
static void |
close(ResultSet rs,
Statement stmt,
Connection conn,
org.slf4j.Logger log)
Tries to close each object from a ResultSet , Statement , Connection triple. |
static void |
close(Statement stmt)
Close the object, suppress all errors/exceptions. |
static String |
determinePostGISVersion(Connection conn,
org.slf4j.Logger log)
|
static ResultSet |
executeQuery(PreparedStatement stmt,
ConnectionManager connManager,
String connId,
long executionTimeout)
Executes the SQL query in the given PreparedStatement object and returns the ResultSet object generated
by the query. |
static String |
getMessage(SQLException e)
|
static void |
log(SQLException e,
org.slf4j.Logger log)
|
static boolean |
useLegayPostGISPredicates(Connection conn,
org.slf4j.Logger log)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public JDBCUtils()
Method Detail |
---|
public static void log(SQLException e, org.slf4j.Logger log)
public static String getMessage(SQLException e)
public static void close(Connection conn)
conn
- public static void close(ResultSet resultSet)
resultSet
- public static void close(Statement stmt)
stmt
- public static void close(ResultSet rs, Statement stmt, Connection conn, org.slf4j.Logger log)
ResultSet
, Statement
, Connection
triple.
Useful for cleaning up in finally
clauses.
rs
- ResultSet
to be closedstmt
- Statement
to be closedconn
- Connection
to be closedlog
- used to log error messages, may be nullpublic static String determinePostGISVersion(Connection conn, org.slf4j.Logger log)
public static boolean useLegayPostGISPredicates(Connection conn, org.slf4j.Logger log)
public static ResultSet executeQuery(PreparedStatement stmt, ConnectionManager connManager, String connId, long executionTimeout) throws SQLException
PreparedStatement
object and returns the ResultSet object generated
by the query.
stmt
- statement to be executed, must not be null
connManager
- ConnectionManager
that has been used to retrieve the connection (needed for invalidating
cancelled queries), must not be null
connId
- id of the connection pool that the connection belongs to (needed for invalidating cancelled queries),
must not be null
executionTimeout
- timeout in milliseconds, if 0 or negative, timeout is disabled
ResultSet
object that contains the data produced by the query, never null
SQLException
- if an execution timeout or a database access error occurs; this method is called on a closed
PreparedStatement
or the SQL statement does not return a ResultSet
object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |