Class JdbcCacheConnector
java.lang.Object
eu.europa.esig.dss.spi.client.jdbc.JdbcCacheConnector
This class executes calls to a
javax.sql.DataSource
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
closeQuietly
(Connection c, Statement s, ResultSet rs) Close the statement and connection and resultset without throwing the exceptionint
This method allows to execute a query with a custom set of arguments, such as SELECT, UPDATE or DELETE, by handling an exception.int
executeThrowable
(SqlQuery query) This method allows executing of INSERT, UPDATE or DELETE queries, by throwing an exception in case of an errorprotected void
Rollback transaction for the givenConnection
select
(SqlSelectQuery selectQuery, Object... arguments) This method executes the query and returns a collection of selected objectsboolean
tableQuery
(SqlQuery query) This method allows table creation, removal and existence check
-
Constructor Details
-
JdbcCacheConnector
Default constructor- Parameters:
dataSource
-DataSource
to connect with
-
-
Method Details
-
execute
This method allows to execute a query with a custom set of arguments, such as SELECT, UPDATE or DELETE, by handling an exception. -
select
This method executes the query and returns a collection of selected objects- Parameters:
selectQuery
-SqlSelectQuery
the query to SELECT objectsarguments
- an array ofObject
s, representing the query arguments- Returns:
- a collection of
SqlRecord
s
-
tableQuery
This method allows table creation, removal and existence check- Parameters:
query
-SqlQuery
the query- Returns:
- TRUE if the query has been executed successfully, FALSE otherwise
-
executeThrowable
This method allows executing of INSERT, UPDATE or DELETE queries, by throwing an exception in case of an error- Parameters:
query
-SqlQuery
the query- Returns:
- number of concerned rows
- Throws:
SQLException
- if an exception occurs
-
rollback
Rollback transaction for the givenConnection
- Parameters:
c
-Connection
-
closeQuietly
Close the statement and connection and resultset without throwing the exception- Parameters:
c
- the connections
- the statementrs
- the ResultSet
-