Class JdbcCacheConnector
java.lang.Object
eu.europa.esig.dss.spi.client.jdbc.JdbcCacheConnector
This class executes calls to a data source
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classThis class represents a row result object of an SQL SELECT querystatic classThis class represents a relationship a column's name to be requested and their corresponding target classes to convert the extracted values to -
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(String 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(String selectQuery, Collection<JdbcCacheConnector.JdbcResultRequest> requests, Object... arguments) This method executes the query and returns a collection of selected objectsbooleantableQuery(String 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
public Collection<JdbcCacheConnector.JdbcResultRecord> select(String selectQuery, Collection<JdbcCacheConnector.JdbcResultRequest> requests, Object... arguments) This method executes the query and returns a collection of selected objects- Parameters:
selectQuery-Stringthe query string to SELECT objectsrequests- a collection ofJdbcCacheConnector.JdbcResultRequests representing a relationship between the column names to be extracted and their respectful classes to cast the extracted objects toarguments- an array ofObjects, representing the query arguments- Returns:
- a collection of
JdbcCacheConnector.JdbcResultRecords
-
tableQuery
This method allows table creation, removal and existence check- Parameters:
query-Stringthe 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-Stringthe query string- 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
-