Class JdbcCacheConnector
java.lang.Object
eu.europa.esig.dss.spi.client.jdbc.JdbcCacheConnector
This class executes calls to a
javax.sql.DataSource-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcloseQuietly(Connection c, Statement s, ResultSet rs) Close the statement and connection and resultset without throwing the exceptionintThis method allows to execute a query with a custom set of arguments, such as SELECT, UPDATE or DELETE, by handling an exception.intexecuteThrowable(SqlQuery query) This method allows executing of INSERT, UPDATE or DELETE queries, by throwing an exception in case of an errorprotected voidRollback transaction for the givenConnectionselect(SqlSelectQuery selectQuery, Object... arguments) This method executes the query and returns a collection of selected objectsbooleantableQuery(SqlQuery query) This method allows table creation, removal and existence check
-
Constructor Details
-
JdbcCacheConnector
Default constructor- Parameters:
dataSource-DataSourceto 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-SqlSelectQuerythe query to SELECT objectsarguments- an array ofObjects, representing the query arguments- Returns:
- a collection of
SqlRecords
-
tableQuery
This method allows table creation, removal and existence check- Parameters:
query-SqlQuerythe 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-SqlQuerythe 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
-