Package io.agroal.test
Interface MockConnection
-
- All Superinterfaces:
AutoCloseable,Connection,Wrapper
- All Known Implementing Classes:
MockConnection.Empty
public interface MockConnection extends Connection
- Author:
- Luis Barreiro
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classMockConnection.Empty
-
Field Summary
-
Fields inherited from interface java.sql.Connection
TRANSACTION_NONE, TRANSACTION_READ_COMMITTED, TRANSACTION_READ_UNCOMMITTED, TRANSACTION_REPEATABLE_READ, TRANSACTION_SERIALIZABLE
-
-
Method Summary
All Methods Instance Methods Default Methods Modifier and Type Method Description default voidabort(Executor executor)default voidclearWarnings()default voidclose()default voidcommit()default ArraycreateArrayOf(String typeName, Object[] elements)default BlobcreateBlob()default ClobcreateClob()default NClobcreateNClob()default SQLXMLcreateSQLXML()default StatementcreateStatement()default StatementcreateStatement(int resultSetType, int resultSetConcurrency)default StatementcreateStatement(int resultSetType, int resultSetConcurrency, int resultSetHoldability)default StructcreateStruct(String typeName, Object[] attributes)default booleangetAutoCommit()default StringgetCatalog()default PropertiesgetClientInfo()default StringgetClientInfo(String name)default intgetHoldability()default DatabaseMetaDatagetMetaData()default intgetNetworkTimeout()default StringgetSchema()default intgetTransactionIsolation()default Map<String,Class<?>>getTypeMap()default SQLWarninggetWarnings()default booleanisClosed()default booleanisReadOnly()default booleanisValid(int timeout)default booleanisWrapperFor(Class<?> target)default StringnativeSQL(String sql)default CallableStatementprepareCall(String sql)default CallableStatementprepareCall(String sql, int resultSetType, int resultSetConcurrency)default CallableStatementprepareCall(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability)default PreparedStatementprepareStatement(String sql)default PreparedStatementprepareStatement(String sql, int autoGeneratedKeys)default PreparedStatementprepareStatement(String sql, int[] columnIndexes)default PreparedStatementprepareStatement(String sql, int resultSetType, int resultSetConcurrency)default PreparedStatementprepareStatement(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability)default PreparedStatementprepareStatement(String sql, String[] columnNames)default voidreleaseSavepoint(Savepoint savepoint)default voidrollback()default voidrollback(Savepoint savepoint)default voidsetAutoCommit(boolean autoCommit)default voidsetCatalog(String catalog)default voidsetClientInfo(String name, String value)default voidsetClientInfo(Properties properties)default voidsetHoldability(int holdability)default voidsetNetworkTimeout(Executor executor, int milliseconds)default voidsetReadOnly(boolean readOnly)default SavepointsetSavepoint()default SavepointsetSavepoint(String name)default voidsetSchema(String schema)default voidsetTransactionIsolation(int level)default voidsetTypeMap(Map<String,Class<?>> map)default <T> Tunwrap(Class<T> target)-
Methods inherited from interface java.sql.Connection
beginRequest, endRequest, setShardingKey, setShardingKey, setShardingKeyIfValid, setShardingKeyIfValid
-
-
-
-
Method Detail
-
createStatement
default Statement createStatement() throws SQLException
- Specified by:
createStatementin interfaceConnection- Throws:
SQLException
-
prepareStatement
default PreparedStatement prepareStatement(String sql) throws SQLException
- Specified by:
prepareStatementin interfaceConnection- Throws:
SQLException
-
prepareCall
default CallableStatement prepareCall(String sql) throws SQLException
- Specified by:
prepareCallin interfaceConnection- Throws:
SQLException
-
nativeSQL
default String nativeSQL(String sql) throws SQLException
- Specified by:
nativeSQLin interfaceConnection- Throws:
SQLException
-
getAutoCommit
default boolean getAutoCommit() throws SQLException- Specified by:
getAutoCommitin interfaceConnection- Throws:
SQLException
-
setAutoCommit
default void setAutoCommit(boolean autoCommit) throws SQLException- Specified by:
setAutoCommitin interfaceConnection- Throws:
SQLException
-
commit
default void commit() throws SQLException- Specified by:
commitin interfaceConnection- Throws:
SQLException
-
rollback
default void rollback() throws SQLException- Specified by:
rollbackin interfaceConnection- Throws:
SQLException
-
close
default void close() throws SQLException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceConnection- Throws:
SQLException
-
isClosed
default boolean isClosed() throws SQLException- Specified by:
isClosedin interfaceConnection- Throws:
SQLException
-
getMetaData
default DatabaseMetaData getMetaData() throws SQLException
- Specified by:
getMetaDatain interfaceConnection- Throws:
SQLException
-
isReadOnly
default boolean isReadOnly() throws SQLException- Specified by:
isReadOnlyin interfaceConnection- Throws:
SQLException
-
setReadOnly
default void setReadOnly(boolean readOnly) throws SQLException- Specified by:
setReadOnlyin interfaceConnection- Throws:
SQLException
-
getCatalog
default String getCatalog() throws SQLException
- Specified by:
getCatalogin interfaceConnection- Throws:
SQLException
-
setCatalog
default void setCatalog(String catalog) throws SQLException
- Specified by:
setCatalogin interfaceConnection- Throws:
SQLException
-
getTransactionIsolation
default int getTransactionIsolation() throws SQLException- Specified by:
getTransactionIsolationin interfaceConnection- Throws:
SQLException
-
setTransactionIsolation
default void setTransactionIsolation(int level) throws SQLException- Specified by:
setTransactionIsolationin interfaceConnection- Throws:
SQLException
-
getWarnings
default SQLWarning getWarnings() throws SQLException
- Specified by:
getWarningsin interfaceConnection- Throws:
SQLException
-
clearWarnings
default void clearWarnings() throws SQLException- Specified by:
clearWarningsin interfaceConnection- Throws:
SQLException
-
createStatement
default Statement createStatement(int resultSetType, int resultSetConcurrency) throws SQLException
- Specified by:
createStatementin interfaceConnection- Throws:
SQLException
-
prepareStatement
default PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency) throws SQLException
- Specified by:
prepareStatementin interfaceConnection- Throws:
SQLException
-
prepareCall
default CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency) throws SQLException
- Specified by:
prepareCallin interfaceConnection- Throws:
SQLException
-
getTypeMap
default Map<String,Class<?>> getTypeMap() throws SQLException
- Specified by:
getTypeMapin interfaceConnection- Throws:
SQLException
-
setTypeMap
default void setTypeMap(Map<String,Class<?>> map) throws SQLException
- Specified by:
setTypeMapin interfaceConnection- Throws:
SQLException
-
getHoldability
default int getHoldability() throws SQLException- Specified by:
getHoldabilityin interfaceConnection- Throws:
SQLException
-
setHoldability
default void setHoldability(int holdability) throws SQLException- Specified by:
setHoldabilityin interfaceConnection- Throws:
SQLException
-
setSavepoint
default Savepoint setSavepoint() throws SQLException
- Specified by:
setSavepointin interfaceConnection- Throws:
SQLException
-
setSavepoint
default Savepoint setSavepoint(String name) throws SQLException
- Specified by:
setSavepointin interfaceConnection- Throws:
SQLException
-
rollback
default void rollback(Savepoint savepoint) throws SQLException
- Specified by:
rollbackin interfaceConnection- Throws:
SQLException
-
releaseSavepoint
default void releaseSavepoint(Savepoint savepoint) throws SQLException
- Specified by:
releaseSavepointin interfaceConnection- Throws:
SQLException
-
createStatement
default Statement createStatement(int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException
- Specified by:
createStatementin interfaceConnection- Throws:
SQLException
-
prepareStatement
default PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException
- Specified by:
prepareStatementin interfaceConnection- Throws:
SQLException
-
prepareCall
default CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException
- Specified by:
prepareCallin interfaceConnection- Throws:
SQLException
-
prepareStatement
default PreparedStatement prepareStatement(String sql, int autoGeneratedKeys) throws SQLException
- Specified by:
prepareStatementin interfaceConnection- Throws:
SQLException
-
prepareStatement
default PreparedStatement prepareStatement(String sql, int[] columnIndexes) throws SQLException
- Specified by:
prepareStatementin interfaceConnection- Throws:
SQLException
-
prepareStatement
default PreparedStatement prepareStatement(String sql, String[] columnNames) throws SQLException
- Specified by:
prepareStatementin interfaceConnection- Throws:
SQLException
-
createClob
default Clob createClob() throws SQLException
- Specified by:
createClobin interfaceConnection- Throws:
SQLException
-
createBlob
default Blob createBlob() throws SQLException
- Specified by:
createBlobin interfaceConnection- Throws:
SQLException
-
createNClob
default NClob createNClob() throws SQLException
- Specified by:
createNClobin interfaceConnection- Throws:
SQLException
-
createSQLXML
default SQLXML createSQLXML() throws SQLException
- Specified by:
createSQLXMLin interfaceConnection- Throws:
SQLException
-
isValid
default boolean isValid(int timeout) throws SQLException- Specified by:
isValidin interfaceConnection- Throws:
SQLException
-
setClientInfo
default void setClientInfo(String name, String value) throws SQLClientInfoException
- Specified by:
setClientInfoin interfaceConnection- Throws:
SQLClientInfoException
-
getClientInfo
default String getClientInfo(String name) throws SQLException
- Specified by:
getClientInfoin interfaceConnection- Throws:
SQLException
-
getClientInfo
default Properties getClientInfo() throws SQLException
- Specified by:
getClientInfoin interfaceConnection- Throws:
SQLException
-
setClientInfo
default void setClientInfo(Properties properties) throws SQLClientInfoException
- Specified by:
setClientInfoin interfaceConnection- Throws:
SQLClientInfoException
-
createArrayOf
default Array createArrayOf(String typeName, Object[] elements) throws SQLException
- Specified by:
createArrayOfin interfaceConnection- Throws:
SQLException
-
createStruct
default Struct createStruct(String typeName, Object[] attributes) throws SQLException
- Specified by:
createStructin interfaceConnection- Throws:
SQLException
-
getSchema
default String getSchema() throws SQLException
- Specified by:
getSchemain interfaceConnection- Throws:
SQLException
-
setSchema
default void setSchema(String schema) throws SQLException
- Specified by:
setSchemain interfaceConnection- Throws:
SQLException
-
abort
default void abort(Executor executor) throws SQLException
- Specified by:
abortin interfaceConnection- Throws:
SQLException
-
setNetworkTimeout
default void setNetworkTimeout(Executor executor, int milliseconds) throws SQLException
- Specified by:
setNetworkTimeoutin interfaceConnection- Throws:
SQLException
-
getNetworkTimeout
default int getNetworkTimeout() throws SQLException- Specified by:
getNetworkTimeoutin interfaceConnection- Throws:
SQLException
-
unwrap
default <T> T unwrap(Class<T> target) throws SQLException
- Specified by:
unwrapin interfaceWrapper- Throws:
SQLException
-
isWrapperFor
default boolean isWrapperFor(Class<?> target) throws SQLException
- Specified by:
isWrapperForin interfaceWrapper- Throws:
SQLException
-
-