Add @Override annotation where needed.

Starting with Java 6, we can annotate with @Override a class method implementing
a method from an interface.
pull/42/head
Guillaume Smet 11 years ago
parent da5c02683d
commit d415ba8353

@ -144,12 +144,14 @@ public class HikariConfig implements HikariConfigMBean
}
/** {@inheritDoc} */
@Override
public int getAcquireIncrement()
{
return acquireIncrement;
}
/** {@inheritDoc} */
@Override
public void setAcquireIncrement(int acquireIncrement)
{
if (acquireIncrement < 1)
@ -160,12 +162,14 @@ public class HikariConfig implements HikariConfigMBean
}
/** {@inheritDoc} */
@Override
public int getAcquireRetries()
{
return acquireRetries;
}
/** {@inheritDoc} */
@Override
public void setAcquireRetries(int acquireRetries)
{
if (acquireRetries < 0)
@ -176,12 +180,14 @@ public class HikariConfig implements HikariConfigMBean
}
/** {@inheritDoc} */
@Override
public long getAcquireRetryDelay()
{
return acquireRetryDelay;
}
/** {@inheritDoc} */
@Override
public void setAcquireRetryDelay(long acquireRetryDelayMs)
{
if (acquireRetryDelayMs < 0)
@ -280,12 +286,14 @@ public class HikariConfig implements HikariConfigMBean
}
/** {@inheritDoc} */
@Override
public long getConnectionTimeout()
{
return connectionTimeout;
}
/** {@inheritDoc} */
@Override
public void setConnectionTimeout(long connectionTimeoutMs)
{
if (connectionTimeoutMs == 0)
@ -363,12 +371,14 @@ public class HikariConfig implements HikariConfigMBean
}
/** {@inheritDoc} */
@Override
public long getIdleTimeout()
{
return idleTimeout;
}
/** {@inheritDoc} */
@Override
public void setIdleTimeout(long idleTimeoutMs)
{
this.idleTimeout = idleTimeoutMs;
@ -467,12 +477,14 @@ public class HikariConfig implements HikariConfigMBean
}
/** {@inheritDoc} */
@Override
public long getLeakDetectionThreshold()
{
return leakDetectionThreshold;
}
/** {@inheritDoc} */
@Override
public void setLeakDetectionThreshold(long leakDetectionThresholdMs)
{
this.leakDetectionThreshold = leakDetectionThresholdMs;
@ -484,24 +496,28 @@ public class HikariConfig implements HikariConfigMBean
}
/** {@inheritDoc} */
@Override
public long getMaxLifetime()
{
return maxLifetime;
}
/** {@inheritDoc} */
@Override
public void setMaxLifetime(long maxLifetimeMs)
{
this.maxLifetime = maxLifetimeMs;
}
/** {@inheritDoc} */
@Override
public int getMinimumPoolSize()
{
return minPoolSize;
}
/** {@inheritDoc} */
@Override
public void setMinimumPoolSize(int minPoolSize)
{
if (minPoolSize < 0)
@ -512,12 +528,14 @@ public class HikariConfig implements HikariConfigMBean
}
/** {@inheritDoc} */
@Override
public int getMaximumPoolSize()
{
return maxPoolSize;
}
/** {@inheritDoc} */
@Override
public void setMaximumPoolSize(int maxPoolSize)
{
if (maxPoolSize < 0)
@ -528,6 +546,7 @@ public class HikariConfig implements HikariConfigMBean
}
/** {@inheritDoc} */
@Override
public String getPoolName()
{
return poolName;

@ -67,6 +67,7 @@ public class HikariDataSource extends HikariConfig implements DataSource
}
/** {@inheritDoc} */
@Override
public Connection getConnection() throws SQLException
{
if (isShutdown)
@ -96,6 +97,7 @@ public class HikariDataSource extends HikariConfig implements DataSource
}
/** {@inheritDoc} */
@Override
public Connection getConnection(String username, String password) throws SQLException
{
LOGGER.warn("getConnection() with username and password is not supported, calling getConnection() instead");
@ -104,12 +106,14 @@ public class HikariDataSource extends HikariConfig implements DataSource
}
/** {@inheritDoc} */
@Override
public PrintWriter getLogWriter() throws SQLException
{
return (pool.dataSource != null ? pool.dataSource.getLogWriter() : null);
}
/** {@inheritDoc} */
@Override
public void setLogWriter(PrintWriter out) throws SQLException
{
if (pool.dataSource != null)
@ -119,24 +123,28 @@ public class HikariDataSource extends HikariConfig implements DataSource
}
/** {@inheritDoc} */
@Override
public void setLoginTimeout(int seconds) throws SQLException
{
this.loginTimeout = seconds;
}
/** {@inheritDoc} */
@Override
public int getLoginTimeout() throws SQLException
{
return loginTimeout;
}
/** {@inheritDoc} */
@Override
public java.util.logging.Logger getParentLogger() throws SQLFeatureNotSupportedException
{
throw new SQLFeatureNotSupportedException();
}
/** {@inheritDoc} */
@Override
public <T> T unwrap(Class<T> iface) throws SQLException
{
// TODO Auto-generated method stub
@ -144,6 +152,7 @@ public class HikariDataSource extends HikariConfig implements DataSource
}
/** {@inheritDoc} */
@Override
public boolean isWrapperFor(Class<?> iface) throws SQLException
{
return (this.getClass().isAssignableFrom(iface));

@ -503,6 +503,7 @@ public final class HikariPool implements HikariPoolMBean, IBagStateListener
*/
private class HouseKeeper extends TimerTask
{
@Override
public void run()
{
debug = LOGGER.isDebugEnabled();

@ -119,6 +119,7 @@ public abstract class ConnectionProxy implements IHikariConnectionProxy
// ***********************************************************************
/** {@inheritDoc} */
@Override
public final void captureStack(long leakDetectionThreshold, Timer scheduler)
{
StackTraceElement[] trace = Thread.currentThread().getStackTrace();
@ -130,6 +131,7 @@ public abstract class ConnectionProxy implements IHikariConnectionProxy
}
/** {@inheritDoc} */
@Override
public final void checkException(SQLException sqle)
{
String sqlState = sqle.getSQLState();
@ -148,30 +150,35 @@ public abstract class ConnectionProxy implements IHikariConnectionProxy
}
/** {@inheritDoc} */
@Override
public final long getCreationTime()
{
return creationTime;
}
/** {@inheritDoc} */
@Override
public final long getLastAccess()
{
return lastAccess;
}
/** {@inheritDoc} */
@Override
public final boolean isBrokenConnection()
{
return forceClose;
}
/** {@inheritDoc} */
@Override
public final void realClose() throws SQLException
{
delegate.close();
}
/** {@inheritDoc} */
@Override
public final void resetConnectionState() throws SQLException
{
if (!delegate.getAutoCommit())
@ -207,12 +214,14 @@ public abstract class ConnectionProxy implements IHikariConnectionProxy
}
/** {@inheritDoc} */
@Override
public final void unclose()
{
isClosed = false;
}
/** {@inheritDoc} */
@Override
public final void untrackStatement(Object statement)
{
// If the connection is not closed. If it is closed, it means this is being
@ -266,6 +275,7 @@ public abstract class ConnectionProxy implements IHikariConnectionProxy
// **********************************************************************
/** {@inheritDoc} */
@Override
public final void close() throws SQLException
{
if (!isClosed)
@ -314,12 +324,14 @@ public abstract class ConnectionProxy implements IHikariConnectionProxy
}
/** {@inheritDoc} */
@Override
public final boolean isClosed() throws SQLException
{
return isClosed;
}
/** {@inheritDoc} */
@Override
public final Statement createStatement() throws SQLException
{
checkClosed();
@ -336,6 +348,7 @@ public abstract class ConnectionProxy implements IHikariConnectionProxy
}
/** {@inheritDoc} */
@Override
public final Statement createStatement(int resultSetType, int resultSetConcurrency) throws SQLException
{
checkClosed();
@ -352,6 +365,7 @@ public abstract class ConnectionProxy implements IHikariConnectionProxy
}
/** {@inheritDoc} */
@Override
public final Statement createStatement(int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException
{
checkClosed();
@ -368,6 +382,7 @@ public abstract class ConnectionProxy implements IHikariConnectionProxy
}
/** {@inheritDoc} */
@Override
public final CallableStatement prepareCall(String sql) throws SQLException
{
checkClosed();
@ -384,6 +399,7 @@ public abstract class ConnectionProxy implements IHikariConnectionProxy
}
/** {@inheritDoc} */
@Override
public final CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency) throws SQLException
{
checkClosed();
@ -400,6 +416,7 @@ public abstract class ConnectionProxy implements IHikariConnectionProxy
}
/** {@inheritDoc} */
@Override
public final CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException
{
checkClosed();
@ -416,6 +433,7 @@ public abstract class ConnectionProxy implements IHikariConnectionProxy
}
/** {@inheritDoc} */
@Override
public final PreparedStatement prepareStatement(String sql) throws SQLException
{
checkClosed();
@ -432,6 +450,7 @@ public abstract class ConnectionProxy implements IHikariConnectionProxy
}
/** {@inheritDoc} */
@Override
public final PreparedStatement prepareStatement(String sql, int autoGeneratedKeys) throws SQLException
{
checkClosed();
@ -448,6 +467,7 @@ public abstract class ConnectionProxy implements IHikariConnectionProxy
}
/** {@inheritDoc} */
@Override
public final PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency) throws SQLException
{
checkClosed();
@ -464,6 +484,7 @@ public abstract class ConnectionProxy implements IHikariConnectionProxy
}
/** {@inheritDoc} */
@Override
public final PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException
{
checkClosed();
@ -480,6 +501,7 @@ public abstract class ConnectionProxy implements IHikariConnectionProxy
}
/** {@inheritDoc} */
@Override
public final PreparedStatement prepareStatement(String sql, int[] columnIndexes) throws SQLException
{
checkClosed();
@ -496,6 +518,7 @@ public abstract class ConnectionProxy implements IHikariConnectionProxy
}
/** {@inheritDoc} */
@Override
public final PreparedStatement prepareStatement(String sql, String[] columnNames) throws SQLException
{
checkClosed();
@ -512,6 +535,7 @@ public abstract class ConnectionProxy implements IHikariConnectionProxy
}
/** {@inheritDoc} */
@Override
public final boolean isValid(int timeout) throws SQLException
{
if (isClosed)
@ -531,6 +555,7 @@ public abstract class ConnectionProxy implements IHikariConnectionProxy
}
/** {@inheritDoc} */
@Override
public final void setAutoCommit(boolean autoCommit) throws SQLException
{
checkClosed();
@ -547,6 +572,7 @@ public abstract class ConnectionProxy implements IHikariConnectionProxy
}
/** {@inheritDoc} */
@Override
public final void setReadOnly(boolean readOnly) throws SQLException
{
checkClosed();
@ -563,6 +589,7 @@ public abstract class ConnectionProxy implements IHikariConnectionProxy
}
/** {@inheritDoc} */
@Override
public final void setTransactionIsolation(int level) throws SQLException
{
checkClosed();
@ -595,12 +622,14 @@ public abstract class ConnectionProxy implements IHikariConnectionProxy
}
/** {@inheritDoc} */
@Override
public final boolean isWrapperFor(Class<?> iface) throws SQLException
{
return iface.isInstance(delegate);
}
/** {@inheritDoc} */
@Override
@SuppressWarnings("unchecked")
public final <T> T unwrap(Class<T> iface) throws SQLException
{

@ -37,6 +37,7 @@ public abstract class PreparedStatementProxy extends StatementProxy implements P
// **********************************************************************
/** {@inheritDoc} */
@Override
public final ResultSet executeQuery() throws SQLException
{
try

@ -50,6 +50,7 @@ public abstract class StatementProxy implements Statement
// **********************************************************************
/** {@inheritDoc} */
@Override
public final void close() throws SQLException
{
if (isClosed)
@ -72,6 +73,7 @@ public abstract class StatementProxy implements Statement
}
/** {@inheritDoc} */
@Override
public final ResultSet executeQuery(String sql) throws SQLException
{
try
@ -86,6 +88,7 @@ public abstract class StatementProxy implements Statement
}
/** {@inheritDoc} */
@Override
public final ResultSet getResultSet() throws SQLException
{
try
@ -100,6 +103,7 @@ public abstract class StatementProxy implements Statement
}
/** {@inheritDoc} */
@Override
public final ResultSet getGeneratedKeys() throws SQLException
{
try
@ -114,6 +118,7 @@ public abstract class StatementProxy implements Statement
}
/** {@inheritDoc} */
@Override
public final Connection getConnection() throws SQLException
{
return connection;

@ -84,6 +84,7 @@ public final class DriverDataSource implements DataSource
return loginTimeout;
}
@Override
public java.util.logging.Logger getParentLogger() throws SQLFeatureNotSupportedException
{
throw new SQLFeatureNotSupportedException();

@ -44,44 +44,53 @@ import org.mockito.stubbing.Answer;
*/
public class MockDataSource implements DataSource
{
@Override
public Connection getConnection() throws SQLException
{
return createMockConnection();
}
@Override
public Connection getConnection(String username, String password) throws SQLException
{
return getConnection();
}
@Override
public PrintWriter getLogWriter() throws SQLException
{
return null;
}
@Override
public void setLogWriter(PrintWriter out) throws SQLException
{
}
@Override
public void setLoginTimeout(int seconds) throws SQLException
{
}
@Override
public int getLoginTimeout() throws SQLException
{
return 0;
}
@Override
public Logger getParentLogger() throws SQLFeatureNotSupportedException
{
return null;
}
@Override
public <T> T unwrap(Class<T> iface) throws SQLException
{
return null;
}
@Override
public boolean isWrapperFor(Class<?> iface) throws SQLException
{
return false;
@ -110,6 +119,7 @@ public class MockDataSource implements DataSource
when(mockConnection.prepareStatement(anyString(), anyInt(), anyInt())).thenReturn(mockPreparedStatement);
when(mockConnection.prepareStatement(anyString(), anyInt(), anyInt(), anyInt())).thenReturn(mockPreparedStatement);
doAnswer(new Answer<Void>() {
@Override
public Void answer(InvocationOnMock invocation) throws Throwable
{
return null;

@ -8,12 +8,14 @@ import java.sql.Statement;
public abstract class StubBaseConnection implements Connection
{
/** {@inheritDoc} */
@Override
public Statement createStatement() throws SQLException
{
return new StubStatement(this);
}
/** {@inheritDoc} */
@Override
public PreparedStatement prepareStatement(String sql) throws SQLException
{
return new StubPreparedStatement(this);

@ -52,301 +52,353 @@ public class StubConnection extends StubBaseConnection implements Connection
}
/** {@inheritDoc} */
@Override
public <T> T unwrap(Class<T> iface) throws SQLException
{
return null;
}
/** {@inheritDoc} */
@Override
public boolean isWrapperFor(Class<?> iface) throws SQLException
{
return false;
}
/** {@inheritDoc} */
@Override
public CallableStatement prepareCall(String sql) throws SQLException
{
return null;
}
/** {@inheritDoc} */
@Override
public String nativeSQL(String sql) throws SQLException
{
return null;
}
/** {@inheritDoc} */
@Override
public void setAutoCommit(boolean autoCommit) throws SQLException
{
this.autoCommit = autoCommit;
}
/** {@inheritDoc} */
@Override
public boolean getAutoCommit() throws SQLException
{
return autoCommit;
}
/** {@inheritDoc} */
@Override
public void commit() throws SQLException
{
}
/** {@inheritDoc} */
@Override
public void rollback() throws SQLException
{
}
/** {@inheritDoc} */
@Override
public void close() throws SQLException
{
}
/** {@inheritDoc} */
@Override
public boolean isClosed() throws SQLException
{
return false;
}
/** {@inheritDoc} */
@Override
public DatabaseMetaData getMetaData() throws SQLException
{
return null;
}
/** {@inheritDoc} */
@Override
public void setReadOnly(boolean readOnly) throws SQLException
{
}
/** {@inheritDoc} */
@Override
public boolean isReadOnly() throws SQLException
{
return false;
}
/** {@inheritDoc} */
@Override
public void setCatalog(String catalog) throws SQLException
{
this.catalog = catalog;
}
/** {@inheritDoc} */
@Override
public String getCatalog() throws SQLException
{
return catalog;
}
/** {@inheritDoc} */
@Override
public void setTransactionIsolation(int level) throws SQLException
{
this.isolation = level;
}
/** {@inheritDoc} */
@Override
public int getTransactionIsolation() throws SQLException
{
return isolation;
}
/** {@inheritDoc} */
@Override
public SQLWarning getWarnings() throws SQLException
{
return null;
}
/** {@inheritDoc} */
@Override
public void clearWarnings() throws SQLException
{
}
/** {@inheritDoc} */
@Override
public Statement createStatement(int resultSetType, int resultSetConcurrency) throws SQLException
{
return null;
}
/** {@inheritDoc} */
@Override
public PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency) throws SQLException
{
return new StubPreparedStatement(this);
}
/** {@inheritDoc} */
@Override
public CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency) throws SQLException
{
return null;
}
/** {@inheritDoc} */
@Override
public Map<String, Class<?>> getTypeMap() throws SQLException
{
return null;
}
/** {@inheritDoc} */
@Override
public void setTypeMap(Map<String, Class<?>> map) throws SQLException
{
}
/** {@inheritDoc} */
@Override
public void setHoldability(int holdability) throws SQLException
{
}
/** {@inheritDoc} */
@Override
public int getHoldability() throws SQLException
{
return (int) foo;
}
/** {@inheritDoc} */
@Override
public Savepoint setSavepoint() throws SQLException
{
return null;
}
/** {@inheritDoc} */
@Override
public Savepoint setSavepoint(String name) throws SQLException
{
return null;
}
/** {@inheritDoc} */
@Override
public void rollback(Savepoint savepoint) throws SQLException
{
}
/** {@inheritDoc} */
@Override
public void releaseSavepoint(Savepoint savepoint) throws SQLException
{
}
/** {@inheritDoc} */
@Override
public Statement createStatement(int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException
{
return null;
}
/** {@inheritDoc} */
@Override
public PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException
{
return new StubPreparedStatement(this);
}
/** {@inheritDoc} */
@Override
public CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException
{
return null;
}
/** {@inheritDoc} */
@Override
public PreparedStatement prepareStatement(String sql, int autoGeneratedKeys) throws SQLException
{
return new StubPreparedStatement(this);
}
/** {@inheritDoc} */
@Override
public PreparedStatement prepareStatement(String sql, int[] columnIndexes) throws SQLException
{
return new StubPreparedStatement(this);
}
/** {@inheritDoc} */
@Override
public PreparedStatement prepareStatement(String sql, String[] columnNames) throws SQLException
{
return new StubPreparedStatement(this);
}
/** {@inheritDoc} */
@Override
public Clob createClob() throws SQLException
{
return null;
}
/** {@inheritDoc} */
@Override
public Blob createBlob() throws SQLException
{
return null;
}
/** {@inheritDoc} */
@Override
public NClob createNClob() throws SQLException
{
return null;
}
/** {@inheritDoc} */
@Override
public SQLXML createSQLXML() throws SQLException
{
return null;
}
/** {@inheritDoc} */
@Override
public boolean isValid(int timeout) throws SQLException
{
return true;
}
/** {@inheritDoc} */
@Override
public void setClientInfo(String name, String value) throws SQLClientInfoException
{
}
/** {@inheritDoc} */
@Override
public void setClientInfo(Properties properties) throws SQLClientInfoException
{
}
/** {@inheritDoc} */
@Override
public String getClientInfo(String name) throws SQLException
{
return null;
}
/** {@inheritDoc} */
@Override
public Properties getClientInfo() throws SQLException
{
return null;
}
/** {@inheritDoc} */
@Override
public Array createArrayOf(String typeName, Object[] elements) throws SQLException
{
return null;
}
/** {@inheritDoc} */
@Override
public Struct createStruct(String typeName, Object[] attributes) throws SQLException
{
return null;
}
/** {@inheritDoc} */
@Override
public void setSchema(String schema) throws SQLException
{
}
/** {@inheritDoc} */
@Override
public String getSchema() throws SQLException
{
return null;
}
/** {@inheritDoc} */
@Override
public void abort(Executor executor) throws SQLException
{
}
/** {@inheritDoc} */
@Override
public void setNetworkTimeout(Executor executor, int milliseconds) throws SQLException
{
}
/** {@inheritDoc} */
@Override
public int getNetworkTimeout() throws SQLException
{
return 0;

@ -55,53 +55,62 @@ public class StubDataSource implements DataSource
}
/** {@inheritDoc} */
@Override
public PrintWriter getLogWriter() throws SQLException
{
return logWriter;
}
/** {@inheritDoc} */
@Override
public void setLogWriter(PrintWriter out) throws SQLException
{
this.logWriter = out;
}
/** {@inheritDoc} */
@Override
public void setLoginTimeout(int seconds) throws SQLException
{
}
/** {@inheritDoc} */
@Override
public int getLoginTimeout() throws SQLException
{
return 0;
}
/** {@inheritDoc} */
@Override
public Logger getParentLogger() throws SQLFeatureNotSupportedException
{
return null;
}
/** {@inheritDoc} */
@Override
public <T> T unwrap(Class<T> iface) throws SQLException
{
return null;
}
/** {@inheritDoc} */
@Override
public boolean isWrapperFor(Class<?> iface) throws SQLException
{
return false;
}
/** {@inheritDoc} */
@Override
public Connection getConnection() throws SQLException
{
return new StubConnection();
}
/** {@inheritDoc} */
@Override
public Connection getConnection(String username, String password) throws SQLException
{
return new StubConnection();

@ -47,42 +47,49 @@ public class StubDriver implements Driver
}
/** {@inheritDoc} */
@Override
public Connection connect(String url, Properties info) throws SQLException
{
return new StubConnection();
}
/** {@inheritDoc} */
@Override
public boolean acceptsURL(String url) throws SQLException
{
return true;
}
/** {@inheritDoc} */
@Override
public DriverPropertyInfo[] getPropertyInfo(String url, Properties info) throws SQLException
{
return null;
}
/** {@inheritDoc} */
@Override
public int getMajorVersion()
{
return 0;
}
/** {@inheritDoc} */
@Override
public int getMinorVersion()
{
return 0;
}
/** {@inheritDoc} */
@Override
public boolean jdbcCompliant()
{
return true;
}
/** {@inheritDoc} */
@Override
public Logger getParentLogger() throws SQLFeatureNotSupportedException
{
return null;

@ -51,95 +51,112 @@ public class StubPreparedStatement extends StubStatement implements PreparedStat
}
/** {@inheritDoc} */
@Override
public ResultSet executeQuery(String sql) throws SQLException
{
return new StubResultSet();
}
/** {@inheritDoc} */
@Override
public int executeUpdate(String sql) throws SQLException
{
return 0;
}
/** {@inheritDoc} */
@Override
public int getMaxFieldSize() throws SQLException
{
throw new SQLException("No reason", "08999");
}
/** {@inheritDoc} */
@Override
public void setMaxFieldSize(int max) throws SQLException
{
}
/** {@inheritDoc} */
@Override
public int getMaxRows() throws SQLException
{
return 0;
}
/** {@inheritDoc} */
@Override
public void setMaxRows(int max) throws SQLException
{
}
/** {@inheritDoc} */
@Override
public void setEscapeProcessing(boolean enable) throws SQLException
{
}
/** {@inheritDoc} */
@Override
public int getQueryTimeout() throws SQLException
{
return 0;
}
/** {@inheritDoc} */
@Override
public void setQueryTimeout(int seconds) throws SQLException
{
}
/** {@inheritDoc} */
@Override
public void cancel() throws SQLException
{
}
/** {@inheritDoc} */
@Override
public SQLWarning getWarnings() throws SQLException
{
return null;
}
/** {@inheritDoc} */
@Override
public void clearWarnings() throws SQLException
{
}
/** {@inheritDoc} */
@Override
public void setCursorName(String name) throws SQLException
{
}
/** {@inheritDoc} */
@Override
public boolean execute(String sql) throws SQLException
{
return false;
}
/** {@inheritDoc} */
@Override
public ResultSet getResultSet() throws SQLException
{
return new StubResultSet();
}
/** {@inheritDoc} */
@Override
public int getUpdateCount() throws SQLException
{
return 0;
}
/** {@inheritDoc} */
@Override
public boolean getMoreResults() throws SQLException
{
if (isClosed())
@ -150,419 +167,498 @@ public class StubPreparedStatement extends StubStatement implements PreparedStat
}
/** {@inheritDoc} */
@Override
public void setFetchDirection(int direction) throws SQLException
{
}
/** {@inheritDoc} */
@Override
public int getFetchDirection() throws SQLException
{
return 0;
}
/** {@inheritDoc} */
@Override
public void setFetchSize(int rows) throws SQLException
{
}
/** {@inheritDoc} */
@Override
public int getFetchSize() throws SQLException
{
return 0;
}
/** {@inheritDoc} */
@Override
public int getResultSetConcurrency() throws SQLException
{
return 0;
}
/** {@inheritDoc} */
@Override
public int getResultSetType() throws SQLException
{
return 0;
}
/** {@inheritDoc} */
@Override
public void addBatch(String sql) throws SQLException
{
}
/** {@inheritDoc} */
@Override
public void clearBatch() throws SQLException
{
}
/** {@inheritDoc} */
@Override
public int[] executeBatch() throws SQLException
{
return null;
}
/** {@inheritDoc} */
@Override
public boolean getMoreResults(int current) throws SQLException
{
return false;
}
/** {@inheritDoc} */
@Override
public ResultSet getGeneratedKeys() throws SQLException
{
return new StubResultSet();
}
/** {@inheritDoc} */
@Override
public int executeUpdate(String sql, int autoGeneratedKeys) throws SQLException
{
return 0;
}
/** {@inheritDoc} */
@Override
public int executeUpdate(String sql, int[] columnIndexes) throws SQLException
{
return 0;
}
/** {@inheritDoc} */
@Override
public int executeUpdate(String sql, String[] columnNames) throws SQLException
{
return 0;
}
/** {@inheritDoc} */
@Override
public boolean execute(String sql, int autoGeneratedKeys) throws SQLException
{
return false;
}
/** {@inheritDoc} */
@Override
public boolean execute(String sql, int[] columnIndexes) throws SQLException
{
return false;
}
/** {@inheritDoc} */
@Override
public boolean execute(String sql, String[] columnNames) throws SQLException
{
return false;
}
/** {@inheritDoc} */
@Override
public int getResultSetHoldability() throws SQLException
{
return 0;
}
/** {@inheritDoc} */
@Override
public void setPoolable(boolean poolable) throws SQLException
{
}
/** {@inheritDoc} */
@Override
public boolean isPoolable() throws SQLException
{
return false;
}
/** {@inheritDoc} */
@Override
public void closeOnCompletion() throws SQLException
{
}
/** {@inheritDoc} */
@Override
public boolean isCloseOnCompletion() throws SQLException
{
return false;
}
/** {@inheritDoc} */
@Override
public <T> T unwrap(Class<T> iface) throws SQLException
{
return null;
}
/** {@inheritDoc} */
@Override
public boolean isWrapperFor(Class<?> iface) throws SQLException
{
return false;
}
/** {@inheritDoc} */
@Override
public ResultSet executeQuery() throws SQLException
{
return new StubResultSet();
}
/** {@inheritDoc} */
@Override
public int executeUpdate() throws SQLException
{
return 0;
}
/** {@inheritDoc} */
@Override
public void setNull(int parameterIndex, int sqlType) throws SQLException
{
}
/** {@inheritDoc} */
@Override
public void setBoolean(int parameterIndex, boolean x) throws SQLException
{
}
/** {@inheritDoc} */
@Override
public void setByte(int parameterIndex, byte x) throws SQLException
{
}
/** {@inheritDoc} */
@Override
public void setShort(int parameterIndex, short x) throws SQLException
{
}
/** {@inheritDoc} */
@Override
public void setInt(int parameterIndex, int x) throws SQLException
{
}
/** {@inheritDoc} */
@Override
public void setLong(int parameterIndex, long x) throws SQLException
{
}
/** {@inheritDoc} */
@Override
public void setFloat(int parameterIndex, float x) throws SQLException
{
}
/** {@inheritDoc} */
@Override
public void setDouble(int parameterIndex, double x) throws SQLException
{
}
/** {@inheritDoc} */
@Override
public void setBigDecimal(int parameterIndex, BigDecimal x) throws SQLException
{
}
/** {@inheritDoc} */
@Override
public void setString(int parameterIndex, String x) throws SQLException
{
}
/** {@inheritDoc} */
@Override
public void setBytes(int parameterIndex, byte[] x) throws SQLException
{
}
/** {@inheritDoc} */
@Override
public void setDate(int parameterIndex, Date x) throws SQLException
{
}
/** {@inheritDoc} */
@Override
public void setTime(int parameterIndex, Time x) throws SQLException
{
}
/** {@inheritDoc} */
@Override
public void setTimestamp(int parameterIndex, Timestamp x) throws SQLException
{
}
/** {@inheritDoc} */
@Override
public void setAsciiStream(int parameterIndex, InputStream x, int length) throws SQLException
{
}
/** {@inheritDoc} */
@Override
public void setUnicodeStream(int parameterIndex, InputStream x, int length) throws SQLException
{
}
/** {@inheritDoc} */
@Override
public void setBinaryStream(int parameterIndex, InputStream x, int length) throws SQLException
{
}
/** {@inheritDoc} */
@Override
public void clearParameters() throws SQLException
{
}
/** {@inheritDoc} */
@Override
public void setObject(int parameterIndex, Object x, int targetSqlType) throws SQLException
{
}
/** {@inheritDoc} */
@Override
public void setObject(int parameterIndex, Object x) throws SQLException
{
}
/** {@inheritDoc} */
@Override
public boolean execute() throws SQLException
{
return false;
}
/** {@inheritDoc} */
@Override
public void addBatch() throws SQLException
{
}
/** {@inheritDoc} */
@Override
public void setCharacterStream(int parameterIndex, Reader reader, int length) throws SQLException
{
}
/** {@inheritDoc} */
@Override
public void setRef(int parameterIndex, Ref x) throws SQLException
{
}
/** {@inheritDoc} */
@Override
public void setBlob(int parameterIndex, Blob x) throws SQLException
{
}
/** {@inheritDoc} */
@Override
public void setClob(int parameterIndex, Clob x) throws SQLException
{
}
/** {@inheritDoc} */
@Override
public void setArray(int parameterIndex, Array x) throws SQLException
{
}
/** {@inheritDoc} */
@Override
public ResultSetMetaData getMetaData() throws SQLException
{
return null;
}
/** {@inheritDoc} */
@Override
public void setDate(int parameterIndex, Date x, Calendar cal) throws SQLException
{
}
/** {@inheritDoc} */
@Override
public void setTime(int parameterIndex, Time x, Calendar cal) throws SQLException
{
}
/** {@inheritDoc} */
@Override
public void setTimestamp(int parameterIndex, Timestamp x, Calendar cal) throws SQLException
{
}
/** {@inheritDoc} */
@Override
public void setNull(int parameterIndex, int sqlType, String typeName) throws SQLException
{
}
/** {@inheritDoc} */
@Override
public void setURL(int parameterIndex, URL x) throws SQLException
{
}
/** {@inheritDoc} */
@Override
public ParameterMetaData getParameterMetaData() throws SQLException
{
return null;
}
/** {@inheritDoc} */
@Override
public void setRowId(int parameterIndex, RowId x) throws SQLException
{
}
/** {@inheritDoc} */
@Override
public void setNString(int parameterIndex, String value) throws SQLException
{
}
/** {@inheritDoc} */
@Override
public void setNCharacterStream(int parameterIndex, Reader value, long length) throws SQLException
{
}
/** {@inheritDoc} */
@Override
public void setNClob(int parameterIndex, NClob value) throws SQLException
{
}
/** {@inheritDoc} */
@Override
public void setClob(int parameterIndex, Reader reader, long length) throws SQLException
{
}
/** {@inheritDoc} */
@Override
public void setBlob(int parameterIndex, InputStream inputStream, long length) throws SQLException
{
}
/** {@inheritDoc} */
@Override
public void setNClob(int parameterIndex, Reader reader, long length) throws SQLException
{
}
/** {@inheritDoc} */
@Override
public void setSQLXML(int parameterIndex, SQLXML xmlObject) throws SQLException
{
}
/** {@inheritDoc} */
@Override
public void setObject(int parameterIndex, Object x, int targetSqlType, int scaleOrLength) throws SQLException
{
}
/** {@inheritDoc} */
@Override
public void setAsciiStream(int parameterIndex, InputStream x, long length) throws SQLException
{
}
/** {@inheritDoc} */
@Override
public void setBinaryStream(int parameterIndex, InputStream x, long length) throws SQLException
{
}
/** {@inheritDoc} */
@Override
public void setCharacterStream(int parameterIndex, Reader reader, long length) throws SQLException
{
}
/** {@inheritDoc} */
@Override
public void setAsciiStream(int parameterIndex, InputStream x) throws SQLException
{
}
/** {@inheritDoc} */
@Override
public void setBinaryStream(int parameterIndex, InputStream x) throws SQLException
{
}
/** {@inheritDoc} */
@Override
public void setCharacterStream(int parameterIndex, Reader reader) throws SQLException
{
}
/** {@inheritDoc} */
@Override
public void setNCharacterStream(int parameterIndex, Reader value) throws SQLException
{
}
/** {@inheritDoc} */
@Override
public void setClob(int parameterIndex, Reader reader) throws SQLException
{
}
/** {@inheritDoc} */
@Override
public void setBlob(int parameterIndex, InputStream inputStream) throws SQLException
{
}
/** {@inheritDoc} */
@Override
public void setNClob(int parameterIndex, Reader reader) throws SQLException
{
}

File diff suppressed because it is too large Load Diff

@ -37,6 +37,7 @@ public class StubStatement implements Statement
}
/** {@inheritDoc} */
@Override
public <T> T unwrap(Class<T> iface) throws SQLException
{
checkClosed();
@ -44,6 +45,7 @@ public class StubStatement implements Statement
}
/** {@inheritDoc} */
@Override
public boolean isWrapperFor(Class<?> iface) throws SQLException
{
checkClosed();
@ -51,6 +53,7 @@ public class StubStatement implements Statement
}
/** {@inheritDoc} */
@Override
public ResultSet executeQuery(String sql) throws SQLException
{
checkClosed();
@ -59,6 +62,7 @@ public class StubStatement implements Statement
}
/** {@inheritDoc} */
@Override
public int executeUpdate(String sql) throws SQLException
{
checkClosed();
@ -66,12 +70,14 @@ public class StubStatement implements Statement
}
/** {@inheritDoc} */
@Override
public void close() throws SQLException
{
closed = true;
}
/** {@inheritDoc} */
@Override
public int getMaxFieldSize() throws SQLException
{
checkClosed();
@ -79,12 +85,14 @@ public class StubStatement implements Statement
}
/** {@inheritDoc} */
@Override
public void setMaxFieldSize(int max) throws SQLException
{
checkClosed();
}
/** {@inheritDoc} */
@Override
public int getMaxRows() throws SQLException
{
checkClosed();
@ -92,18 +100,21 @@ public class StubStatement implements Statement
}
/** {@inheritDoc} */
@Override
public void setMaxRows(int max) throws SQLException
{
checkClosed();
}
/** {@inheritDoc} */
@Override
public void setEscapeProcessing(boolean enable) throws SQLException
{
checkClosed();
}
/** {@inheritDoc} */
@Override
public int getQueryTimeout() throws SQLException
{
checkClosed();
@ -111,18 +122,21 @@ public class StubStatement implements Statement
}
/** {@inheritDoc} */
@Override
public void setQueryTimeout(int seconds) throws SQLException
{
checkClosed();
}
/** {@inheritDoc} */
@Override
public void cancel() throws SQLException
{
checkClosed();
}
/** {@inheritDoc} */
@Override
public SQLWarning getWarnings() throws SQLException
{
checkClosed();
@ -130,18 +144,21 @@ public class StubStatement implements Statement
}
/** {@inheritDoc} */
@Override
public void clearWarnings() throws SQLException
{
checkClosed();
}
/** {@inheritDoc} */
@Override
public void setCursorName(String name) throws SQLException
{
checkClosed();
}
/** {@inheritDoc} */
@Override
public boolean execute(String sql) throws SQLException
{
checkClosed();
@ -149,6 +166,7 @@ public class StubStatement implements Statement
}
/** {@inheritDoc} */
@Override
public ResultSet getResultSet() throws SQLException
{
checkClosed();
@ -156,6 +174,7 @@ public class StubStatement implements Statement
}
/** {@inheritDoc} */
@Override
public int getUpdateCount() throws SQLException
{
checkClosed();
@ -163,6 +182,7 @@ public class StubStatement implements Statement
}
/** {@inheritDoc} */
@Override
public boolean getMoreResults() throws SQLException
{
checkClosed();
@ -170,12 +190,14 @@ public class StubStatement implements Statement
}
/** {@inheritDoc} */
@Override
public void setFetchDirection(int direction) throws SQLException
{
checkClosed();
}
/** {@inheritDoc} */
@Override
public int getFetchDirection() throws SQLException
{
checkClosed();
@ -183,12 +205,14 @@ public class StubStatement implements Statement
}
/** {@inheritDoc} */
@Override
public void setFetchSize(int rows) throws SQLException
{
checkClosed();
}
/** {@inheritDoc} */
@Override
public int getFetchSize() throws SQLException
{
checkClosed();
@ -196,6 +220,7 @@ public class StubStatement implements Statement
}
/** {@inheritDoc} */
@Override
public int getResultSetConcurrency() throws SQLException
{
checkClosed();
@ -203,6 +228,7 @@ public class StubStatement implements Statement
}
/** {@inheritDoc} */
@Override
public int getResultSetType() throws SQLException
{
checkClosed();
@ -210,18 +236,21 @@ public class StubStatement implements Statement
}
/** {@inheritDoc} */
@Override
public void addBatch(String sql) throws SQLException
{
checkClosed();
}
/** {@inheritDoc} */
@Override
public void clearBatch() throws SQLException
{
checkClosed();
}
/** {@inheritDoc} */
@Override
public int[] executeBatch() throws SQLException
{
checkClosed();
@ -229,6 +258,7 @@ public class StubStatement implements Statement
}
/** {@inheritDoc} */
@Override
public Connection getConnection() throws SQLException
{
checkClosed();
@ -236,6 +266,7 @@ public class StubStatement implements Statement
}
/** {@inheritDoc} */
@Override
public boolean getMoreResults(int current) throws SQLException
{
checkClosed();
@ -243,6 +274,7 @@ public class StubStatement implements Statement
}
/** {@inheritDoc} */
@Override
public ResultSet getGeneratedKeys() throws SQLException
{
checkClosed();
@ -250,6 +282,7 @@ public class StubStatement implements Statement
}
/** {@inheritDoc} */
@Override
public int executeUpdate(String sql, int autoGeneratedKeys) throws SQLException
{
checkClosed();
@ -257,6 +290,7 @@ public class StubStatement implements Statement
}
/** {@inheritDoc} */
@Override
public int executeUpdate(String sql, int[] columnIndexes) throws SQLException
{
checkClosed();
@ -264,6 +298,7 @@ public class StubStatement implements Statement
}
/** {@inheritDoc} */
@Override
public int executeUpdate(String sql, String[] columnNames) throws SQLException
{
checkClosed();
@ -271,6 +306,7 @@ public class StubStatement implements Statement
}
/** {@inheritDoc} */
@Override
public boolean execute(String sql, int autoGeneratedKeys) throws SQLException
{
checkClosed();
@ -278,6 +314,7 @@ public class StubStatement implements Statement
}
/** {@inheritDoc} */
@Override
public boolean execute(String sql, int[] columnIndexes) throws SQLException
{
checkClosed();
@ -285,6 +322,7 @@ public class StubStatement implements Statement
}
/** {@inheritDoc} */
@Override
public boolean execute(String sql, String[] columnNames) throws SQLException
{
checkClosed();
@ -292,6 +330,7 @@ public class StubStatement implements Statement
}
/** {@inheritDoc} */
@Override
public int getResultSetHoldability() throws SQLException
{
checkClosed();
@ -299,18 +338,21 @@ public class StubStatement implements Statement
}
/** {@inheritDoc} */
@Override
public boolean isClosed() throws SQLException
{
return closed;
}
/** {@inheritDoc} */
@Override
public void setPoolable(boolean poolable) throws SQLException
{
checkClosed();
}
/** {@inheritDoc} */
@Override
public boolean isPoolable() throws SQLException
{
checkClosed();
@ -318,12 +360,14 @@ public class StubStatement implements Statement
}
/** {@inheritDoc} */
@Override
public void closeOnCompletion() throws SQLException
{
checkClosed();
}
/** {@inheritDoc} */
@Override
public boolean isCloseOnCompletion() throws SQLException
{
checkClosed();

Loading…
Cancel
Save