cosmetic changes

This commit is contained in:
Jörg Prante 2022-08-03 12:18:56 +02:00
parent 1c1a1ed55a
commit bd9d8b4009
25 changed files with 31 additions and 1545 deletions

View file

@ -1,6 +1,6 @@
group = org.xbib group = org.xbib
name = database name = database
version = 0.0.4 version = 0.0.5
org.gradle.warning.mode = ALL org.gradle.warning.mode = ALL

View file

@ -168,9 +168,6 @@ public class Pool implements BagStateListener {
return config; return config;
} }
/**
* {@inheritDoc}
*/
@Override @Override
public String toString() { public String toString() {
return poolName; return poolName;
@ -339,9 +336,6 @@ public class Pool implements BagStateListener {
} }
} }
/**
* {@inheritDoc}
*/
@Override @Override
public void addBagItem(final int waiting) { public void addBagItem(final int waiting) {
final boolean shouldAdd = waiting - addConnectionQueueReadOnlyView.size() >= 0; final boolean shouldAdd = waiting - addConnectionQueueReadOnlyView.size() >= 0;
@ -955,13 +949,9 @@ public class Pool implements BagStateListener {
} else if (paramClass == boolean.class || paramClass == Boolean.class) { } else if (paramClass == boolean.class || paramClass == Boolean.class) {
writeMethod.invoke(target, Boolean.parseBoolean(propValue.toString())); writeMethod.invoke(target, Boolean.parseBoolean(propValue.toString()));
} else if (paramClass == String.class) { } else if (paramClass == String.class) {
logger.log(Level.FINE, () ->
MessageFormat.format("write method {0} {1}", target, propValue));
writeMethod.invoke(target, propValue.toString()); writeMethod.invoke(target, propValue.toString());
} else { } else {
try { try {
logger.log(Level.FINE, () ->
MessageFormat.format("try to create a new instance of {0}", propValue));
writeMethod.invoke(target, Class.forName(propValue.toString()).getDeclaredConstructor().newInstance()); writeMethod.invoke(target, Class.forName(propValue.toString()).getDeclaredConstructor().newInstance());
} catch (InstantiationException | ClassNotFoundException e) { } catch (InstantiationException | ClassNotFoundException e) {
logger.log(Level.FINE, () -> logger.log(Level.FINE, () ->

View file

@ -661,6 +661,6 @@ public class PoolConfig {
} }
private static String generatePoolName() { private static String generatePoolName() {
return "xbib-pool-jdbc-" + POOL_COUNTER.getAndIncrement(); return "xbib-jdbc-" + POOL_COUNTER.getAndIncrement();
} }
} }

View file

@ -43,9 +43,6 @@ public class PoolDataSource implements DataSource, Closeable {
return pool; return pool;
} }
/**
* {@inheritDoc}
*/
@Override @Override
public Connection getConnection() throws SQLException { public Connection getConnection() throws SQLException {
if (isClosed()) { if (isClosed()) {
@ -70,26 +67,17 @@ public class PoolDataSource implements DataSource, Closeable {
return result.getConnection(); return result.getConnection();
} }
/**
* {@inheritDoc}
*/
@Override @Override
public Connection getConnection(String username, String password) throws SQLException { public Connection getConnection(String username, String password) throws SQLException {
throw new SQLFeatureNotSupportedException(); throw new SQLFeatureNotSupportedException();
} }
/**
* {@inheritDoc}
*/
@Override @Override
public PrintWriter getLogWriter() throws SQLException { public PrintWriter getLogWriter() throws SQLException {
Pool p = pool; Pool p = pool;
return (p != null ? p.getUnwrappedDataSource().getLogWriter() : null); return (p != null ? p.getUnwrappedDataSource().getLogWriter() : null);
} }
/**
* {@inheritDoc}
*/
@Override @Override
public void setLogWriter(PrintWriter out) throws SQLException { public void setLogWriter(PrintWriter out) throws SQLException {
Pool p = pool; Pool p = pool;
@ -98,9 +86,6 @@ public class PoolDataSource implements DataSource, Closeable {
} }
} }
/**
* {@inheritDoc}
*/
@Override @Override
public void setLoginTimeout(int seconds) throws SQLException { public void setLoginTimeout(int seconds) throws SQLException {
Pool p = pool; Pool p = pool;
@ -109,26 +94,17 @@ public class PoolDataSource implements DataSource, Closeable {
} }
} }
/**
* {@inheritDoc}
*/
@Override @Override
public int getLoginTimeout() throws SQLException { public int getLoginTimeout() throws SQLException {
Pool p = pool; Pool p = pool;
return (p != null ? p.getUnwrappedDataSource().getLoginTimeout() : 0); return (p != null ? p.getUnwrappedDataSource().getLoginTimeout() : 0);
} }
/**
* {@inheritDoc}
*/
@Override @Override
public Logger getParentLogger() throws SQLFeatureNotSupportedException { public Logger getParentLogger() throws SQLFeatureNotSupportedException {
throw new SQLFeatureNotSupportedException(); throw new SQLFeatureNotSupportedException();
} }
/**
* {@inheritDoc}
*/
@Override @Override
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
public <T> T unwrap(Class<T> iface) throws SQLException { public <T> T unwrap(Class<T> iface) throws SQLException {
@ -148,9 +124,6 @@ public class PoolDataSource implements DataSource, Closeable {
throw new SQLException("wrapped DataSource is not an instance of " + iface); throw new SQLException("wrapped DataSource is not an instance of " + iface);
} }
/**
* {@inheritDoc}
*/
@Override @Override
public boolean isWrapperFor(Class<?> iface) throws SQLException { public boolean isWrapperFor(Class<?> iface) throws SQLException {
if (iface.isInstance(this)) { if (iface.isInstance(this)) {
@ -214,9 +187,6 @@ public class PoolDataSource implements DataSource, Closeable {
return isShutdown.get(); return isShutdown.get();
} }
/**
* {@inheritDoc}
*/
@Override @Override
public String toString() { public String toString() {
return "PoolDataSource (" + pool + ")"; return "PoolDataSource (" + pool + ")";

View file

@ -113,9 +113,6 @@ public class PoolEntry implements BagEntry {
return ClockSource.elapsedMillis(lastBorrowed); return ClockSource.elapsedMillis(lastBorrowed);
} }
/**
* {@inheritDoc}
*/
@Override @Override
public String toString() { public String toString() {
final long now = ClockSource.currentTime(); final long now = ClockSource.currentTime();
@ -124,25 +121,16 @@ public class PoolEntry implements BagEntry {
+ stateToString(); + stateToString();
} }
/**
* {@inheritDoc}
*/
@Override @Override
public int getState() { public int getState() {
return stateUpdater.get(this); return stateUpdater.get(this);
} }
/**
* {@inheritDoc}
*/
@Override @Override
public boolean compareAndSet(int expect, int update) { public boolean compareAndSet(int expect, int update) {
return stateUpdater.compareAndSet(this, expect, update); return stateUpdater.compareAndSet(this, expect, update);
} }
/**
* {@inheritDoc}
*/
@Override @Override
public void setState(int update) { public void setState(int update) {
stateUpdater.set(this, update); stateUpdater.set(this, update);

View file

@ -83,6 +83,7 @@ public class ProxyCallableStatement extends ProxyPreparedStatement implements Ca
return ((CallableStatement) delegate).getDouble(parameterIndex); return ((CallableStatement) delegate).getDouble(parameterIndex);
} }
@SuppressWarnings("deprecation")
@Override @Override
public BigDecimal getBigDecimal(int parameterIndex, int scale) throws SQLException { public BigDecimal getBigDecimal(int parameterIndex, int scale) throws SQLException {
return ((CallableStatement) delegate).getBigDecimal(parameterIndex, scale); return ((CallableStatement) delegate).getBigDecimal(parameterIndex, scale);

View file

@ -112,10 +112,6 @@ public class ProxyConnection implements Connection {
return isCommitStateDirty; return isCommitStateDirty;
} }
/**
*
* {@inheritDoc}
*/
@Override @Override
public final String toString() { public final String toString() {
return getClass().getSimpleName() + '@' + System.identityHashCode(this) + " wrapping " + delegate; return getClass().getSimpleName() + '@' + System.identityHashCode(this) + " wrapping " + delegate;
@ -215,9 +211,6 @@ public class ProxyConnection implements Connection {
} }
} }
/**
* {@inheritDoc}
*/
@Override @Override
public void close() throws SQLException { public void close() throws SQLException {
closeStatements(); closeStatements();
@ -249,42 +242,26 @@ public class ProxyConnection implements Connection {
} }
} }
/**
* {@inheritDoc}
*/
@Override @Override
public boolean isClosed() throws SQLException { public boolean isClosed() throws SQLException {
return delegate == CLOSED_CONNECTION; return delegate == CLOSED_CONNECTION;
} }
/**
* {@inheritDoc}
*/
@Override @Override
public Statement createStatement() throws SQLException { public Statement createStatement() throws SQLException {
return ProxyFactory.getProxyStatement(this, trackStatement(delegate.createStatement())); return ProxyFactory.getProxyStatement(this, trackStatement(delegate.createStatement()));
} }
/**
* {@inheritDoc}
*/
@Override @Override
public Statement createStatement(int resultSetType, int concurrency) throws SQLException { public Statement createStatement(int resultSetType, int concurrency) throws SQLException {
return ProxyFactory.getProxyStatement(this, trackStatement(delegate.createStatement(resultSetType, concurrency))); return ProxyFactory.getProxyStatement(this, trackStatement(delegate.createStatement(resultSetType, concurrency)));
} }
/**
* {@inheritDoc}
*/
@Override @Override
public Statement createStatement(int resultSetType, int concurrency, int holdability) throws SQLException { public Statement createStatement(int resultSetType, int concurrency, int holdability) throws SQLException {
return ProxyFactory.getProxyStatement(this, trackStatement(delegate.createStatement(resultSetType, concurrency, holdability))); return ProxyFactory.getProxyStatement(this, trackStatement(delegate.createStatement(resultSetType, concurrency, holdability)));
} }
/**
* {@inheritDoc}
*/
@Override @Override
public CallableStatement prepareCall(String sql) throws SQLException { public CallableStatement prepareCall(String sql) throws SQLException {
return ProxyFactory.getProxyCallableStatement(this, trackStatement(delegate.prepareCall(sql))); return ProxyFactory.getProxyCallableStatement(this, trackStatement(delegate.prepareCall(sql)));
@ -295,9 +272,6 @@ public class ProxyConnection implements Connection {
return delegate.nativeSQL(sql); return delegate.nativeSQL(sql);
} }
/**
* {@inheritDoc}
*/
@Override @Override
public CallableStatement prepareCall(String sql, int resultSetType, int concurrency) throws SQLException { public CallableStatement prepareCall(String sql, int resultSetType, int concurrency) throws SQLException {
return ProxyFactory.getProxyCallableStatement(this, trackStatement(delegate.prepareCall(sql, resultSetType, concurrency))); return ProxyFactory.getProxyCallableStatement(this, trackStatement(delegate.prepareCall(sql, resultSetType, concurrency)));
@ -333,57 +307,36 @@ public class ProxyConnection implements Connection {
return delegate.setSavepoint(name); return delegate.setSavepoint(name);
} }
/**
* {@inheritDoc}
*/
@Override @Override
public CallableStatement prepareCall(String sql, int resultSetType, int concurrency, int holdability) throws SQLException { public CallableStatement prepareCall(String sql, int resultSetType, int concurrency, int holdability) throws SQLException {
return ProxyFactory.getProxyCallableStatement(this, trackStatement(delegate.prepareCall(sql, resultSetType, concurrency, holdability))); return ProxyFactory.getProxyCallableStatement(this, trackStatement(delegate.prepareCall(sql, resultSetType, concurrency, holdability)));
} }
/**
* {@inheritDoc}
*/
@Override @Override
public PreparedStatement prepareStatement(String sql) throws SQLException { public PreparedStatement prepareStatement(String sql) throws SQLException {
return ProxyFactory.getProxyPreparedStatement(this, trackStatement(delegate.prepareStatement(sql))); return ProxyFactory.getProxyPreparedStatement(this, trackStatement(delegate.prepareStatement(sql)));
} }
/**
* {@inheritDoc}
*/
@Override @Override
public PreparedStatement prepareStatement(String sql, int autoGeneratedKeys) throws SQLException { public PreparedStatement prepareStatement(String sql, int autoGeneratedKeys) throws SQLException {
return ProxyFactory.getProxyPreparedStatement(this, trackStatement(delegate.prepareStatement(sql, autoGeneratedKeys))); return ProxyFactory.getProxyPreparedStatement(this, trackStatement(delegate.prepareStatement(sql, autoGeneratedKeys)));
} }
/**
* {@inheritDoc}
*/
@Override @Override
public PreparedStatement prepareStatement(String sql, int resultSetType, int concurrency) throws SQLException { public PreparedStatement prepareStatement(String sql, int resultSetType, int concurrency) throws SQLException {
return ProxyFactory.getProxyPreparedStatement(this, trackStatement(delegate.prepareStatement(sql, resultSetType, concurrency))); return ProxyFactory.getProxyPreparedStatement(this, trackStatement(delegate.prepareStatement(sql, resultSetType, concurrency)));
} }
/**
* {@inheritDoc}
*/
@Override @Override
public PreparedStatement prepareStatement(String sql, int resultSetType, int concurrency, int holdability) throws SQLException { public PreparedStatement prepareStatement(String sql, int resultSetType, int concurrency, int holdability) throws SQLException {
return ProxyFactory.getProxyPreparedStatement(this, trackStatement(delegate.prepareStatement(sql, resultSetType, concurrency, holdability))); return ProxyFactory.getProxyPreparedStatement(this, trackStatement(delegate.prepareStatement(sql, resultSetType, concurrency, holdability)));
} }
/**
* {@inheritDoc}
*/
@Override @Override
public PreparedStatement prepareStatement(String sql, int[] columnIndexes) throws SQLException { public PreparedStatement prepareStatement(String sql, int[] columnIndexes) throws SQLException {
return ProxyFactory.getProxyPreparedStatement(this, trackStatement(delegate.prepareStatement(sql, columnIndexes))); return ProxyFactory.getProxyPreparedStatement(this, trackStatement(delegate.prepareStatement(sql, columnIndexes)));
} }
/**
* {@inheritDoc}
*/
@Override @Override
public PreparedStatement prepareStatement(String sql, String[] columnNames) throws SQLException { public PreparedStatement prepareStatement(String sql, String[] columnNames) throws SQLException {
return ProxyFactory.getProxyPreparedStatement(this, trackStatement(delegate.prepareStatement(sql, columnNames))); return ProxyFactory.getProxyPreparedStatement(this, trackStatement(delegate.prepareStatement(sql, columnNames)));
@ -444,18 +397,12 @@ public class ProxyConnection implements Connection {
return delegate.createStruct(typeName, attributes); return delegate.createStruct(typeName, attributes);
} }
/**
* {@inheritDoc}
*/
@Override @Override
public DatabaseMetaData getMetaData() throws SQLException { public DatabaseMetaData getMetaData() throws SQLException {
markCommitStateDirty(); markCommitStateDirty();
return ProxyFactory.getProxyDatabaseMetaData(this, delegate.getMetaData()); return ProxyFactory.getProxyDatabaseMetaData(this, delegate.getMetaData());
} }
/**
* {@inheritDoc}
*/
@Override @Override
public void commit() throws SQLException { public void commit() throws SQLException {
delegate.commit(); delegate.commit();
@ -463,9 +410,6 @@ public class ProxyConnection implements Connection {
lastAccess = ClockSource.currentTime(); lastAccess = ClockSource.currentTime();
} }
/**
* {@inheritDoc}
*/
@Override @Override
public void rollback() throws SQLException { public void rollback() throws SQLException {
delegate.rollback(); delegate.rollback();
@ -473,9 +417,6 @@ public class ProxyConnection implements Connection {
lastAccess = ClockSource.currentTime(); lastAccess = ClockSource.currentTime();
} }
/**
* {@inheritDoc}
*/
@Override @Override
public void rollback(Savepoint savepoint) throws SQLException { public void rollback(Savepoint savepoint) throws SQLException {
delegate.rollback(savepoint); delegate.rollback(savepoint);
@ -488,9 +429,6 @@ public class ProxyConnection implements Connection {
delegate.releaseSavepoint(savepoint); delegate.releaseSavepoint(savepoint);
} }
/**
* {@inheritDoc}
*/
@Override @Override
public void setAutoCommit(boolean autoCommit) throws SQLException { public void setAutoCommit(boolean autoCommit) throws SQLException {
delegate.setAutoCommit(autoCommit); delegate.setAutoCommit(autoCommit);
@ -503,9 +441,6 @@ public class ProxyConnection implements Connection {
return delegate.getAutoCommit(); return delegate.getAutoCommit();
} }
/**
* {@inheritDoc}
*/
@Override @Override
public void setReadOnly(boolean readOnly) throws SQLException { public void setReadOnly(boolean readOnly) throws SQLException {
delegate.setReadOnly(readOnly); delegate.setReadOnly(readOnly);
@ -519,9 +454,6 @@ public class ProxyConnection implements Connection {
return delegate.isReadOnly(); return delegate.isReadOnly();
} }
/**
* {@inheritDoc}
*/
@Override @Override
public void setTransactionIsolation(int level) throws SQLException { public void setTransactionIsolation(int level) throws SQLException {
delegate.setTransactionIsolation(level); delegate.setTransactionIsolation(level);
@ -544,9 +476,6 @@ public class ProxyConnection implements Connection {
delegate.clearWarnings(); delegate.clearWarnings();
} }
/**
* {@inheritDoc}
*/
@Override @Override
public void setCatalog(String catalog) throws SQLException { public void setCatalog(String catalog) throws SQLException {
delegate.setCatalog(catalog); delegate.setCatalog(catalog);
@ -559,9 +488,6 @@ public class ProxyConnection implements Connection {
return delegate.getCatalog(); return delegate.getCatalog();
} }
/**
* {@inheritDoc}
*/
@Override @Override
public void setNetworkTimeout(Executor executor, int milliseconds) throws SQLException { public void setNetworkTimeout(Executor executor, int milliseconds) throws SQLException {
delegate.setNetworkTimeout(executor, milliseconds); delegate.setNetworkTimeout(executor, milliseconds);
@ -574,9 +500,6 @@ public class ProxyConnection implements Connection {
return delegate.getNetworkTimeout(); return delegate.getNetworkTimeout();
} }
/**
* {@inheritDoc}
*/
@Override @Override
public void setSchema(String schema) throws SQLException { public void setSchema(String schema) throws SQLException {
delegate.setSchema(schema); delegate.setSchema(schema);
@ -594,17 +517,11 @@ public class ProxyConnection implements Connection {
delegate.abort(executor); delegate.abort(executor);
} }
/**
* {@inheritDoc}
*/
@Override @Override
public final boolean isWrapperFor(Class<?> iface) throws SQLException { public final boolean isWrapperFor(Class<?> iface) throws SQLException {
return iface.isInstance(delegate) || (delegate != null && delegate.isWrapperFor(iface)); return iface.isInstance(delegate) || (delegate != null && delegate.isWrapperFor(iface));
} }
/**
* {@inheritDoc}
*/
@Override @Override
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
public <T> T unwrap(Class<T> iface) throws SQLException { public <T> T unwrap(Class<T> iface) throws SQLException {

View file

@ -23,18 +23,12 @@ public class ProxyDatabaseMetaData implements DatabaseMetaData {
return connection.checkException(e); return connection.checkException(e);
} }
/**
* {@inheritDoc}
*/
@Override @Override
public String toString() { public String toString() {
final String delegateToString = delegate.toString(); final String delegateToString = delegate.toString();
return this.getClass().getSimpleName() + '@' + System.identityHashCode(this) + " wrapping " + delegateToString; return this.getClass().getSimpleName() + '@' + System.identityHashCode(this) + " wrapping " + delegateToString;
} }
/**
* {@inheritDoc}
*/
@Override @Override
public Connection getConnection() { public Connection getConnection() {
return connection; return connection;
@ -1035,9 +1029,6 @@ public class ProxyDatabaseMetaData implements DatabaseMetaData {
return delegate.generatedKeyAlwaysReturned(); return delegate.generatedKeyAlwaysReturned();
} }
/**
* {@inheritDoc}
*/
@Override @Override
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
public <T> T unwrap(Class<T> iface) throws SQLException { public <T> T unwrap(Class<T> iface) throws SQLException {

View file

@ -55,9 +55,6 @@ public class ProxyLeakTask implements Runnable {
scheduledFuture = executorService.schedule(this, leakDetectionThreshold, TimeUnit.MILLISECONDS); scheduledFuture = executorService.schedule(this, leakDetectionThreshold, TimeUnit.MILLISECONDS);
} }
/**
* {@inheritDoc}
*/
@Override @Override
public void run() { public void run() {
isLeaked = true; isLeaked = true;

View file

@ -30,9 +30,6 @@ public class ProxyPreparedStatement extends ProxyStatement implements PreparedSt
super(connection, statement); super(connection, statement);
} }
/**
* {@inheritDoc}
*/
@Override @Override
public boolean execute() throws SQLException { public boolean execute() throws SQLException {
connection.markCommitStateDirty(); connection.markCommitStateDirty();
@ -199,9 +196,6 @@ public class ProxyPreparedStatement extends ProxyStatement implements PreparedSt
((PreparedStatement) delegate).setNClob(parameterIndex, reader); ((PreparedStatement) delegate).setNClob(parameterIndex, reader);
} }
/**
* {@inheritDoc}
*/
@Override @Override
public ResultSet executeQuery() throws SQLException { public ResultSet executeQuery() throws SQLException {
connection.markCommitStateDirty(); connection.markCommitStateDirty();
@ -209,9 +203,6 @@ public class ProxyPreparedStatement extends ProxyStatement implements PreparedSt
return ProxyFactory.getProxyResultSet(connection, this, resultSet); return ProxyFactory.getProxyResultSet(connection, this, resultSet);
} }
/**
* {@inheritDoc}
*/
@Override @Override
public int executeUpdate() throws SQLException { public int executeUpdate() throws SQLException {
connection.markCommitStateDirty(); connection.markCommitStateDirty();
@ -293,6 +284,7 @@ public class ProxyPreparedStatement extends ProxyStatement implements PreparedSt
((PreparedStatement) delegate).setAsciiStream(parameterIndex, x, length); ((PreparedStatement) delegate).setAsciiStream(parameterIndex, x, length);
} }
@SuppressWarnings("deprecation")
@Override @Override
public void setUnicodeStream(int parameterIndex, InputStream x, int length) throws SQLException { public void setUnicodeStream(int parameterIndex, InputStream x, int length) throws SQLException {
((PreparedStatement) delegate).setUnicodeStream(parameterIndex, x, length); ((PreparedStatement) delegate).setUnicodeStream(parameterIndex, x, length);
@ -318,9 +310,6 @@ public class ProxyPreparedStatement extends ProxyStatement implements PreparedSt
((PreparedStatement) delegate).setObject(parameterIndex, x); ((PreparedStatement) delegate).setObject(parameterIndex, x);
} }
/**
* {@inheritDoc}
*/
@Override @Override
public long executeLargeUpdate() throws SQLException { public long executeLargeUpdate() throws SQLException {
connection.markCommitStateDirty(); connection.markCommitStateDirty();

View file

@ -43,17 +43,11 @@ public class ProxyResultSet implements ResultSet {
return delegate; return delegate;
} }
/**
* {@inheritDoc}
*/
@Override @Override
public String toString() { public String toString() {
return this.getClass().getSimpleName() + '@' + System.identityHashCode(this) + " wrapping " + delegate; return this.getClass().getSimpleName() + '@' + System.identityHashCode(this) + " wrapping " + delegate;
} }
/**
* {@inheritDoc}
*/
@Override @Override
public Statement getStatement() throws SQLException { public Statement getStatement() throws SQLException {
return statement; return statement;
@ -439,9 +433,6 @@ public class ProxyResultSet implements ResultSet {
return delegate.getObject(columnLabel, type); return delegate.getObject(columnLabel, type);
} }
/**
* {@inheritDoc}
*/
@Override @Override
public void updateRow() throws SQLException { public void updateRow() throws SQLException {
connection.markCommitStateDirty(); connection.markCommitStateDirty();
@ -503,6 +494,7 @@ public class ProxyResultSet implements ResultSet {
return delegate.getDouble(columnIndex); return delegate.getDouble(columnIndex);
} }
@SuppressWarnings("deprecation")
@Override @Override
public BigDecimal getBigDecimal(int columnIndex, int scale) throws SQLException { public BigDecimal getBigDecimal(int columnIndex, int scale) throws SQLException {
return delegate.getBigDecimal(columnIndex); return delegate.getBigDecimal(columnIndex);
@ -533,6 +525,7 @@ public class ProxyResultSet implements ResultSet {
return delegate.getAsciiStream(columnIndex); return delegate.getAsciiStream(columnIndex);
} }
@SuppressWarnings("deprecation")
@Override @Override
public InputStream getUnicodeStream(int columnIndex) throws SQLException { public InputStream getUnicodeStream(int columnIndex) throws SQLException {
return delegate.getUnicodeStream(columnIndex); return delegate.getUnicodeStream(columnIndex);
@ -583,6 +576,7 @@ public class ProxyResultSet implements ResultSet {
return delegate.getDouble(columnLabel); return delegate.getDouble(columnLabel);
} }
@SuppressWarnings("deprecation")
@Override @Override
public BigDecimal getBigDecimal(String columnLabel, int scale) throws SQLException { public BigDecimal getBigDecimal(String columnLabel, int scale) throws SQLException {
return delegate.getBigDecimal(columnLabel, scale); return delegate.getBigDecimal(columnLabel, scale);
@ -613,6 +607,7 @@ public class ProxyResultSet implements ResultSet {
return delegate.getAsciiStream(columnLabel); return delegate.getAsciiStream(columnLabel);
} }
@SuppressWarnings("deprecation")
@Override @Override
public InputStream getUnicodeStream(String columnLabel) throws SQLException { public InputStream getUnicodeStream(String columnLabel) throws SQLException {
return delegate.getUnicodeStream(columnLabel); return delegate.getUnicodeStream(columnLabel);
@ -973,18 +968,12 @@ public class ProxyResultSet implements ResultSet {
delegate.updateObject(columnLabel, x); delegate.updateObject(columnLabel, x);
} }
/**
* {@inheritDoc}
*/
@Override @Override
public void insertRow() throws SQLException { public void insertRow() throws SQLException {
connection.markCommitStateDirty(); connection.markCommitStateDirty();
delegate.insertRow(); delegate.insertRow();
} }
/**
* {@inheritDoc}
*/
@Override @Override
public void deleteRow() throws SQLException { public void deleteRow() throws SQLException {
connection.markCommitStateDirty(); connection.markCommitStateDirty();
@ -1011,9 +1000,6 @@ public class ProxyResultSet implements ResultSet {
delegate.moveToCurrentRow(); delegate.moveToCurrentRow();
} }
/**
* {@inheritDoc}
*/
@Override @Override
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
public final <T> T unwrap(Class<T> iface) throws SQLException { public final <T> T unwrap(Class<T> iface) throws SQLException {

View file

@ -33,18 +33,12 @@ public class ProxyStatement implements Statement {
return connection.checkException(e); return connection.checkException(e);
} }
/**
* {@inheritDoc}
*/
@Override @Override
public String toString() { public String toString() {
final String delegateToString = delegate.toString(); final String delegateToString = delegate.toString();
return this.getClass().getSimpleName() + '@' + System.identityHashCode(this) + " wrapping " + delegateToString; return this.getClass().getSimpleName() + '@' + System.identityHashCode(this) + " wrapping " + delegateToString;
} }
/**
* {@inheritDoc}
*/
@Override @Override
public void close() throws SQLException { public void close() throws SQLException {
synchronized (this) { synchronized (this) {
@ -116,9 +110,6 @@ public class ProxyStatement implements Statement {
delegate.setCursorName(name); delegate.setCursorName(name);
} }
/**
* {@inheritDoc}
*/
@Override @Override
public Connection getConnection() throws SQLException { public Connection getConnection() throws SQLException {
return connection; return connection;
@ -129,27 +120,18 @@ public class ProxyStatement implements Statement {
return delegate.getMoreResults(current); return delegate.getMoreResults(current);
} }
/**
* {@inheritDoc}
*/
@Override @Override
public boolean execute(String sql) throws SQLException { public boolean execute(String sql) throws SQLException {
connection.markCommitStateDirty(); connection.markCommitStateDirty();
return delegate.execute(sql); return delegate.execute(sql);
} }
/**
* {@inheritDoc}
*/
@Override @Override
public boolean execute(String sql, int autoGeneratedKeys) throws SQLException { public boolean execute(String sql, int autoGeneratedKeys) throws SQLException {
connection.markCommitStateDirty(); connection.markCommitStateDirty();
return delegate.execute(sql, autoGeneratedKeys); return delegate.execute(sql, autoGeneratedKeys);
} }
/**
* {@inheritDoc}
*/
@Override @Override
public ResultSet executeQuery(String sql) throws SQLException { public ResultSet executeQuery(String sql) throws SQLException {
connection.markCommitStateDirty(); connection.markCommitStateDirty();
@ -157,63 +139,42 @@ public class ProxyStatement implements Statement {
return ProxyFactory.getProxyResultSet(connection, this, resultSet); return ProxyFactory.getProxyResultSet(connection, this, resultSet);
} }
/**
* {@inheritDoc}
*/
@Override @Override
public int executeUpdate(String sql) throws SQLException { public int executeUpdate(String sql) throws SQLException {
connection.markCommitStateDirty(); connection.markCommitStateDirty();
return delegate.executeUpdate(sql); return delegate.executeUpdate(sql);
} }
/**
* {@inheritDoc}
*/
@Override @Override
public int[] executeBatch() throws SQLException { public int[] executeBatch() throws SQLException {
connection.markCommitStateDirty(); connection.markCommitStateDirty();
return delegate.executeBatch(); return delegate.executeBatch();
} }
/**
* {@inheritDoc}
*/
@Override @Override
public int executeUpdate(String sql, int autoGeneratedKeys) throws SQLException { public int executeUpdate(String sql, int autoGeneratedKeys) throws SQLException {
connection.markCommitStateDirty(); connection.markCommitStateDirty();
return delegate.executeUpdate(sql, autoGeneratedKeys); return delegate.executeUpdate(sql, autoGeneratedKeys);
} }
/**
* {@inheritDoc}
*/
@Override @Override
public int executeUpdate(String sql, int[] columnIndexes) throws SQLException { public int executeUpdate(String sql, int[] columnIndexes) throws SQLException {
connection.markCommitStateDirty(); connection.markCommitStateDirty();
return delegate.executeUpdate(sql, columnIndexes); return delegate.executeUpdate(sql, columnIndexes);
} }
/**
* {@inheritDoc}
*/
@Override @Override
public int executeUpdate(String sql, String[] columnNames) throws SQLException { public int executeUpdate(String sql, String[] columnNames) throws SQLException {
connection.markCommitStateDirty(); connection.markCommitStateDirty();
return delegate.executeUpdate(sql, columnNames); return delegate.executeUpdate(sql, columnNames);
} }
/**
* {@inheritDoc}
*/
@Override @Override
public boolean execute(String sql, int[] columnIndexes) throws SQLException { public boolean execute(String sql, int[] columnIndexes) throws SQLException {
connection.markCommitStateDirty(); connection.markCommitStateDirty();
return delegate.execute(sql, columnIndexes); return delegate.execute(sql, columnIndexes);
} }
/**
* {@inheritDoc}
*/
@Override @Override
public boolean execute(String sql, String[] columnNames) throws SQLException { public boolean execute(String sql, String[] columnNames) throws SQLException {
connection.markCommitStateDirty(); connection.markCommitStateDirty();
@ -250,54 +211,36 @@ public class ProxyStatement implements Statement {
return delegate.isCloseOnCompletion(); return delegate.isCloseOnCompletion();
} }
/**
* {@inheritDoc}
*/
@Override @Override
public long[] executeLargeBatch() throws SQLException { public long[] executeLargeBatch() throws SQLException {
connection.markCommitStateDirty(); connection.markCommitStateDirty();
return delegate.executeLargeBatch(); return delegate.executeLargeBatch();
} }
/**
* {@inheritDoc}
*/
@Override @Override
public long executeLargeUpdate(String sql) throws SQLException { public long executeLargeUpdate(String sql) throws SQLException {
connection.markCommitStateDirty(); connection.markCommitStateDirty();
return delegate.executeLargeUpdate(sql); return delegate.executeLargeUpdate(sql);
} }
/**
* {@inheritDoc}
*/
@Override @Override
public long executeLargeUpdate(String sql, int autoGeneratedKeys) throws SQLException { public long executeLargeUpdate(String sql, int autoGeneratedKeys) throws SQLException {
connection.markCommitStateDirty(); connection.markCommitStateDirty();
return delegate.executeLargeUpdate(sql, autoGeneratedKeys); return delegate.executeLargeUpdate(sql, autoGeneratedKeys);
} }
/**
* {@inheritDoc}
*/
@Override @Override
public long executeLargeUpdate(String sql, int[] columnIndexes) throws SQLException { public long executeLargeUpdate(String sql, int[] columnIndexes) throws SQLException {
connection.markCommitStateDirty(); connection.markCommitStateDirty();
return delegate.executeLargeUpdate(sql, columnIndexes); return delegate.executeLargeUpdate(sql, columnIndexes);
} }
/**
* {@inheritDoc}
*/
@Override @Override
public long executeLargeUpdate(String sql, String[] columnNames) throws SQLException { public long executeLargeUpdate(String sql, String[] columnNames) throws SQLException {
connection.markCommitStateDirty(); connection.markCommitStateDirty();
return delegate.executeLargeUpdate(sql, columnNames); return delegate.executeLargeUpdate(sql, columnNames);
} }
/**
* {@inheritDoc}
*/
@Override @Override
public ResultSet getResultSet() throws SQLException { public ResultSet getResultSet() throws SQLException {
final ResultSet resultSet = delegate.getResultSet(); final ResultSet resultSet = delegate.getResultSet();
@ -361,9 +304,6 @@ public class ProxyStatement implements Statement {
delegate.clearBatch(); delegate.clearBatch();
} }
/**
* {@inheritDoc}
*/
@Override @Override
public ResultSet getGeneratedKeys() throws SQLException { public ResultSet getGeneratedKeys() throws SQLException {
ResultSet resultSet = delegate.getGeneratedKeys(); ResultSet resultSet = delegate.getGeneratedKeys();
@ -373,9 +313,6 @@ public class ProxyStatement implements Statement {
return proxyResultSet; return proxyResultSet;
} }
/**
* {@inheritDoc}
*/
@Override @Override
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
public final <T> T unwrap(Class<T> iface) throws SQLException { public final <T> T unwrap(Class<T> iface) throws SQLException {

View file

@ -4,6 +4,10 @@ package org.xbib.jdbc.connection.pool.util;
* Factory class used to create a platform-specific ClockSource. * Factory class used to create a platform-specific ClockSource.
*/ */
public class ClockSourceFactory { public class ClockSourceFactory {
public ClockSourceFactory() {
}
public static ClockSource create() { public static ClockSource create() {
return new NanosecondClockSource(); return new NanosecondClockSource();
} }

View file

@ -137,17 +137,11 @@ public final class FastList<T> implements List<T>, RandomAccess {
return size; return size;
} }
/**
* {@inheritDoc}
*/
@Override @Override
public boolean isEmpty() { public boolean isEmpty() {
return size == 0; return size == 0;
} }
/**
* {@inheritDoc}
*/
@Override @Override
public T set(int index, T element) { public T set(int index, T element) {
T old = elementData[index]; T old = elementData[index];
@ -155,9 +149,6 @@ public final class FastList<T> implements List<T>, RandomAccess {
return old; return old;
} }
/**
* {@inheritDoc}
*/
@Override @Override
public T remove(int index) { public T remove(int index) {
if (size == 0) { if (size == 0) {
@ -172,17 +163,11 @@ public final class FastList<T> implements List<T>, RandomAccess {
return old; return old;
} }
/**
* {@inheritDoc}
*/
@Override @Override
public boolean contains(Object o) { public boolean contains(Object o) {
throw new UnsupportedOperationException(); throw new UnsupportedOperationException();
} }
/**
* {@inheritDoc}
*/
@Override @Override
public Iterator<T> iterator() { public Iterator<T> iterator() {
return new Iterator<>() { return new Iterator<>() {
@ -203,153 +188,96 @@ public final class FastList<T> implements List<T>, RandomAccess {
}; };
} }
/**
* {@inheritDoc}
*/
@Override @Override
public Object[] toArray() { public Object[] toArray() {
throw new UnsupportedOperationException(); throw new UnsupportedOperationException();
} }
/**
* {@inheritDoc}
*/
@Override @Override
public <E> E[] toArray(E[] a) { public <E> E[] toArray(E[] a) {
throw new UnsupportedOperationException(); throw new UnsupportedOperationException();
} }
/**
* {@inheritDoc}
*/
@Override @Override
public boolean containsAll(Collection<?> c) { public boolean containsAll(Collection<?> c) {
throw new UnsupportedOperationException(); throw new UnsupportedOperationException();
} }
/**
* {@inheritDoc}
*/
@Override @Override
public boolean addAll(Collection<? extends T> c) { public boolean addAll(Collection<? extends T> c) {
throw new UnsupportedOperationException(); throw new UnsupportedOperationException();
} }
/**
* {@inheritDoc}
*/
@Override @Override
public boolean addAll(int index, Collection<? extends T> c) { public boolean addAll(int index, Collection<? extends T> c) {
throw new UnsupportedOperationException(); throw new UnsupportedOperationException();
} }
/**
* {@inheritDoc}
*/
@Override @Override
public boolean removeAll(Collection<?> c) { public boolean removeAll(Collection<?> c) {
throw new UnsupportedOperationException(); throw new UnsupportedOperationException();
} }
/**
* {@inheritDoc}
*/
@Override @Override
public boolean retainAll(Collection<?> c) { public boolean retainAll(Collection<?> c) {
throw new UnsupportedOperationException(); throw new UnsupportedOperationException();
} }
/**
* {@inheritDoc}
*/
@Override @Override
public void add(int index, T element) { public void add(int index, T element) {
throw new UnsupportedOperationException(); throw new UnsupportedOperationException();
} }
/**
* {@inheritDoc}
*/
@Override @Override
public int indexOf(Object o) { public int indexOf(Object o) {
throw new UnsupportedOperationException(); throw new UnsupportedOperationException();
} }
/**
* {@inheritDoc}
*/
@Override @Override
public int lastIndexOf(Object o) { public int lastIndexOf(Object o) {
throw new UnsupportedOperationException(); throw new UnsupportedOperationException();
} }
/**
* {@inheritDoc}
*/
@Override @Override
public ListIterator<T> listIterator() { public ListIterator<T> listIterator() {
throw new UnsupportedOperationException(); throw new UnsupportedOperationException();
} }
/**
* {@inheritDoc}
*/
@Override @Override
public ListIterator<T> listIterator(int index) { public ListIterator<T> listIterator(int index) {
throw new UnsupportedOperationException(); throw new UnsupportedOperationException();
} }
/**
* {@inheritDoc}
*/
@Override @Override
public List<T> subList(int fromIndex, int toIndex) { public List<T> subList(int fromIndex, int toIndex) {
throw new UnsupportedOperationException(); throw new UnsupportedOperationException();
} }
/**
* {@inheritDoc}
*/
@Override @Override
public Object clone() { public Object clone() {
throw new UnsupportedOperationException(); throw new UnsupportedOperationException();
} }
/**
* {@inheritDoc}
*/
@Override @Override
public void forEach(Consumer<? super T> action) { public void forEach(Consumer<? super T> action) {
throw new UnsupportedOperationException(); throw new UnsupportedOperationException();
} }
/**
* {@inheritDoc}
*/
@Override @Override
public Spliterator<T> spliterator() { public Spliterator<T> spliterator() {
throw new UnsupportedOperationException(); throw new UnsupportedOperationException();
} }
/**
* {@inheritDoc}
*/
@Override @Override
public boolean removeIf(Predicate<? super T> filter) { public boolean removeIf(Predicate<? super T> filter) {
throw new UnsupportedOperationException(); throw new UnsupportedOperationException();
} }
/**
* {@inheritDoc}
*/
@Override @Override
public void replaceAll(UnaryOperator<T> operator) { public void replaceAll(UnaryOperator<T> operator) {
throw new UnsupportedOperationException(); throw new UnsupportedOperationException();
} }
/**
* {@inheritDoc}
*/
@Override @Override
public void sort(Comparator<? super T> c) { public void sort(Comparator<? super T> c) {
throw new UnsupportedOperationException(); throw new UnsupportedOperationException();

View file

@ -3,73 +3,50 @@ package org.xbib.jdbc.connection.pool.util;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
public class NanosecondClockSource implements ClockSource { public class NanosecondClockSource implements ClockSource {
/**
* {@inheritDoc} public NanosecondClockSource() {
*/ }
@Override @Override
public long currentTime0() { public long currentTime0() {
return System.nanoTime(); return System.nanoTime();
} }
/**
* {@inheritDoc}
*/
@Override @Override
public long toMillis0(final long time) { public long toMillis0(final long time) {
return TimeUnit.NANOSECONDS.toMillis(time); return TimeUnit.NANOSECONDS.toMillis(time);
} }
/**
* {@inheritDoc}
*/
@Override @Override
public long toNanos0(final long time) { public long toNanos0(final long time) {
return time; return time;
} }
/**
* {@inheritDoc}
*/
@Override @Override
public long elapsedMillis0(final long startTime) { public long elapsedMillis0(final long startTime) {
return TimeUnit.NANOSECONDS.toMillis(System.nanoTime() - startTime); return TimeUnit.NANOSECONDS.toMillis(System.nanoTime() - startTime);
} }
/**
* {@inheritDoc}
*/
@Override @Override
public long elapsedMillis0(final long startTime, final long endTime) { public long elapsedMillis0(final long startTime, final long endTime) {
return TimeUnit.NANOSECONDS.toMillis(endTime - startTime); return TimeUnit.NANOSECONDS.toMillis(endTime - startTime);
} }
/**
* {@inheritDoc}
*/
@Override @Override
public long elapsedNanos0(final long startTime) { public long elapsedNanos0(final long startTime) {
return System.nanoTime() - startTime; return System.nanoTime() - startTime;
} }
/**
* {@inheritDoc}
*/
@Override @Override
public long elapsedNanos0(final long startTime, final long endTime) { public long elapsedNanos0(final long startTime, final long endTime) {
return endTime - startTime; return endTime - startTime;
} }
/**
* {@inheritDoc}
*/
@Override @Override
public long plusMillis0(final long time, final long millis) { public long plusMillis0(final long time, final long millis) {
return time + TimeUnit.MILLISECONDS.toNanos(millis); return time + TimeUnit.MILLISECONDS.toNanos(millis);
} }
/**
* {@inheritDoc}
*/
@Override @Override
public TimeUnit getSourceTimeUnit0() { public TimeUnit getSourceTimeUnit0() {
return TimeUnit.NANOSECONDS; return TimeUnit.NANOSECONDS;

View file

@ -9,9 +9,6 @@ public abstract class StubBaseConnection implements Connection {
public volatile boolean throwException; public volatile boolean throwException;
/**
* {@inheritDoc}
*/
@Override @Override
public Statement createStatement() throws SQLException { public Statement createStatement() throws SQLException {
if (throwException) { if (throwException) {
@ -20,9 +17,6 @@ public abstract class StubBaseConnection implements Connection {
return new StubStatement(this); return new StubStatement(this);
} }
/**
* {@inheritDoc}
*/
@Override @Override
public PreparedStatement prepareStatement(String sql) throws SQLException { public PreparedStatement prepareStatement(String sql) throws SQLException {
if (throwException) { if (throwException) {

View file

@ -48,9 +48,6 @@ public class StubConnection extends StubBaseConnection implements Connection {
} }
} }
/**
* {@inheritDoc}
*/
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
@Override @Override
public <T> T unwrap(Class<T> iface) throws SQLException { public <T> T unwrap(Class<T> iface) throws SQLException {
@ -65,9 +62,6 @@ public class StubConnection extends StubBaseConnection implements Connection {
throw new SQLException("Wrapped connection is not an instance of " + iface); throw new SQLException("Wrapped connection is not an instance of " + iface);
} }
/**
* {@inheritDoc}
*/
@Override @Override
public boolean isWrapperFor(Class<?> iface) throws SQLException { public boolean isWrapperFor(Class<?> iface) throws SQLException {
if (throwException) { if (throwException) {
@ -76,9 +70,6 @@ public class StubConnection extends StubBaseConnection implements Connection {
return false; return false;
} }
/**
* {@inheritDoc}
*/
@Override @Override
public CallableStatement prepareCall(String sql) throws SQLException { public CallableStatement prepareCall(String sql) throws SQLException {
if (throwException) { if (throwException) {
@ -87,17 +78,11 @@ public class StubConnection extends StubBaseConnection implements Connection {
return null; return null;
} }
/**
* {@inheritDoc}
*/
@Override @Override
public String nativeSQL(String sql) throws SQLException { public String nativeSQL(String sql) throws SQLException {
return null; return null;
} }
/**
* {@inheritDoc}
*/
@Override @Override
public void setAutoCommit(boolean autoCommit) throws SQLException { public void setAutoCommit(boolean autoCommit) throws SQLException {
if (throwException) { if (throwException) {
@ -106,41 +91,26 @@ public class StubConnection extends StubBaseConnection implements Connection {
this.autoCommit = autoCommit; this.autoCommit = autoCommit;
} }
/**
* {@inheritDoc}
*/
@Override @Override
public boolean getAutoCommit() throws SQLException { public boolean getAutoCommit() throws SQLException {
return autoCommit; return autoCommit;
} }
/**
* {@inheritDoc}
*/
@Override @Override
public void commit() throws SQLException { public void commit() throws SQLException {
} }
/**
* {@inheritDoc}
*/
@Override @Override
public void rollback() throws SQLException { public void rollback() throws SQLException {
} }
/**
* {@inheritDoc}
*/
@Override @Override
public void close() throws SQLException { public void close() throws SQLException {
} }
/**
* {@inheritDoc}
*/
@Override @Override
public boolean isClosed() throws SQLException { public boolean isClosed() throws SQLException {
if (throwException) { if (throwException) {
@ -149,17 +119,11 @@ public class StubConnection extends StubBaseConnection implements Connection {
return false; return false;
} }
/**
* {@inheritDoc}
*/
@Override @Override
public DatabaseMetaData getMetaData() throws SQLException { public DatabaseMetaData getMetaData() throws SQLException {
return null; return null;
} }
/**
* {@inheritDoc}
*/
@Override @Override
public void setReadOnly(boolean readOnly) throws SQLException { public void setReadOnly(boolean readOnly) throws SQLException {
if (throwException) { if (throwException) {
@ -167,9 +131,6 @@ public class StubConnection extends StubBaseConnection implements Connection {
} }
} }
/**
* {@inheritDoc}
*/
@Override @Override
public boolean isReadOnly() throws SQLException { public boolean isReadOnly() throws SQLException {
if (throwException) { if (throwException) {
@ -178,9 +139,6 @@ public class StubConnection extends StubBaseConnection implements Connection {
return false; return false;
} }
/**
* {@inheritDoc}
*/
@Override @Override
public void setCatalog(String catalog) throws SQLException { public void setCatalog(String catalog) throws SQLException {
if (throwException) { if (throwException) {
@ -189,17 +147,11 @@ public class StubConnection extends StubBaseConnection implements Connection {
this.catalog = catalog; this.catalog = catalog;
} }
/**
* {@inheritDoc}
*/
@Override @Override
public String getCatalog() throws SQLException { public String getCatalog() throws SQLException {
return catalog; return catalog;
} }
/**
* {@inheritDoc}
*/
@Override @Override
public void setTransactionIsolation(int level) throws SQLException { public void setTransactionIsolation(int level) throws SQLException {
if (throwException) { if (throwException) {
@ -208,25 +160,16 @@ public class StubConnection extends StubBaseConnection implements Connection {
this.isolation = level; this.isolation = level;
} }
/**
* {@inheritDoc}
*/
@Override @Override
public int getTransactionIsolation() throws SQLException { public int getTransactionIsolation() throws SQLException {
return isolation; return isolation;
} }
/**
* {@inheritDoc}
*/
@Override @Override
public SQLWarning getWarnings() throws SQLException { public SQLWarning getWarnings() throws SQLException {
return null; return null;
} }
/**
* {@inheritDoc}
*/
@Override @Override
public void clearWarnings() throws SQLException { public void clearWarnings() throws SQLException {
if (throwException) { if (throwException) {
@ -234,9 +177,6 @@ public class StubConnection extends StubBaseConnection implements Connection {
} }
} }
/**
* {@inheritDoc}
*/
@Override @Override
public Statement createStatement(int resultSetType, int resultSetConcurrency) throws SQLException { public Statement createStatement(int resultSetType, int resultSetConcurrency) throws SQLException {
if (throwException) { if (throwException) {
@ -245,9 +185,6 @@ public class StubConnection extends StubBaseConnection implements Connection {
return null; return null;
} }
/**
* {@inheritDoc}
*/
@Override @Override
public PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency) throws SQLException { public PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency) throws SQLException {
if (throwException) { if (throwException) {
@ -256,9 +193,6 @@ public class StubConnection extends StubBaseConnection implements Connection {
return new StubPreparedStatement(this); return new StubPreparedStatement(this);
} }
/**
* {@inheritDoc}
*/
@Override @Override
public CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency) throws SQLException { public CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency) throws SQLException {
if (throwException) { if (throwException) {
@ -267,69 +201,42 @@ public class StubConnection extends StubBaseConnection implements Connection {
return null; return null;
} }
/**
* {@inheritDoc}
*/
@Override @Override
public Map<String, Class<?>> getTypeMap() throws SQLException { public Map<String, Class<?>> getTypeMap() throws SQLException {
return null; return null;
} }
/**
* {@inheritDoc}
*/
@Override @Override
public void setTypeMap(Map<String, Class<?>> map) throws SQLException { public void setTypeMap(Map<String, Class<?>> map) throws SQLException {
} }
/**
* {@inheritDoc}
*/
@Override @Override
public void setHoldability(int holdability) throws SQLException { public void setHoldability(int holdability) throws SQLException {
} }
/**
* {@inheritDoc}
*/
@Override @Override
public int getHoldability() throws SQLException { public int getHoldability() throws SQLException {
return (int) foo; return (int) foo;
} }
/**
* {@inheritDoc}
*/
@Override @Override
public Savepoint setSavepoint() throws SQLException { public Savepoint setSavepoint() throws SQLException {
return null; return null;
} }
/**
* {@inheritDoc}
*/
@Override @Override
public Savepoint setSavepoint(String name) throws SQLException { public Savepoint setSavepoint(String name) throws SQLException {
return null; return null;
} }
/**
* {@inheritDoc}
*/
@Override @Override
public void rollback(Savepoint savepoint) throws SQLException { public void rollback(Savepoint savepoint) throws SQLException {
} }
/**
* {@inheritDoc}
*/
@Override @Override
public void releaseSavepoint(Savepoint savepoint) throws SQLException { public void releaseSavepoint(Savepoint savepoint) throws SQLException {
} }
/**
* {@inheritDoc}
*/
@Override @Override
public Statement createStatement(int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException { public Statement createStatement(int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException {
if (throwException) { if (throwException) {
@ -338,9 +245,6 @@ public class StubConnection extends StubBaseConnection implements Connection {
return null; return null;
} }
/**
* {@inheritDoc}
*/
@Override @Override
public PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException { public PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException {
if (throwException) { if (throwException) {
@ -349,9 +253,6 @@ public class StubConnection extends StubBaseConnection implements Connection {
return new StubPreparedStatement(this); return new StubPreparedStatement(this);
} }
/**
* {@inheritDoc}
*/
@Override @Override
public CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException { public CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException {
if (throwException) { if (throwException) {
@ -360,9 +261,6 @@ public class StubConnection extends StubBaseConnection implements Connection {
return null; return null;
} }
/**
* {@inheritDoc}
*/
@Override @Override
public PreparedStatement prepareStatement(String sql, int autoGeneratedKeys) throws SQLException { public PreparedStatement prepareStatement(String sql, int autoGeneratedKeys) throws SQLException {
if (throwException) { if (throwException) {
@ -371,9 +269,6 @@ public class StubConnection extends StubBaseConnection implements Connection {
return new StubPreparedStatement(this); return new StubPreparedStatement(this);
} }
/**
* {@inheritDoc}
*/
@Override @Override
public PreparedStatement prepareStatement(String sql, int[] columnIndexes) throws SQLException { public PreparedStatement prepareStatement(String sql, int[] columnIndexes) throws SQLException {
if (throwException) { if (throwException) {
@ -382,9 +277,6 @@ public class StubConnection extends StubBaseConnection implements Connection {
return new StubPreparedStatement(this); return new StubPreparedStatement(this);
} }
/**
* {@inheritDoc}
*/
@Override @Override
public PreparedStatement prepareStatement(String sql, String[] columnNames) throws SQLException { public PreparedStatement prepareStatement(String sql, String[] columnNames) throws SQLException {
if (throwException) { if (throwException) {
@ -393,41 +285,26 @@ public class StubConnection extends StubBaseConnection implements Connection {
return new StubPreparedStatement(this); return new StubPreparedStatement(this);
} }
/**
* {@inheritDoc}
*/
@Override @Override
public Clob createClob() throws SQLException { public Clob createClob() throws SQLException {
return null; return null;
} }
/**
* {@inheritDoc}
*/
@Override @Override
public Blob createBlob() throws SQLException { public Blob createBlob() throws SQLException {
return null; return null;
} }
/**
* {@inheritDoc}
*/
@Override @Override
public NClob createNClob() throws SQLException { public NClob createNClob() throws SQLException {
return null; return null;
} }
/**
* {@inheritDoc}
*/
@Override @Override
public SQLXML createSQLXML() throws SQLException { public SQLXML createSQLXML() throws SQLException {
return null; return null;
} }
/**
* {@inheritDoc}
*/
@Override @Override
public boolean isValid(int timeout) throws SQLException { public boolean isValid(int timeout) throws SQLException {
if (throwException) { if (throwException) {
@ -436,81 +313,48 @@ public class StubConnection extends StubBaseConnection implements Connection {
return true; return true;
} }
/**
* {@inheritDoc}
*/
@Override @Override
public void setClientInfo(String name, String value) throws SQLClientInfoException { public void setClientInfo(String name, String value) throws SQLClientInfoException {
} }
/**
* {@inheritDoc}
*/
@Override @Override
public void setClientInfo(Properties properties) throws SQLClientInfoException { public void setClientInfo(Properties properties) throws SQLClientInfoException {
} }
/**
* {@inheritDoc}
*/
@Override @Override
public String getClientInfo(String name) throws SQLException { public String getClientInfo(String name) throws SQLException {
return null; return null;
} }
/**
* {@inheritDoc}
*/
@Override @Override
public Properties getClientInfo() throws SQLException { public Properties getClientInfo() throws SQLException {
return null; return null;
} }
/**
* {@inheritDoc}
*/
@Override @Override
public Array createArrayOf(String typeName, Object[] elements) throws SQLException { public Array createArrayOf(String typeName, Object[] elements) throws SQLException {
return null; return null;
} }
/**
* {@inheritDoc}
*/
@Override @Override
public Struct createStruct(String typeName, Object[] attributes) throws SQLException { public Struct createStruct(String typeName, Object[] attributes) throws SQLException {
return null; return null;
} }
/**
* {@inheritDoc}
*/
public void setSchema(String schema) throws SQLException { public void setSchema(String schema) throws SQLException {
} }
/**
* {@inheritDoc}
*/
public String getSchema() throws SQLException { public String getSchema() throws SQLException {
return null; return null;
} }
/**
* {@inheritDoc}
*/
public void abort(Executor executor) throws SQLException { public void abort(Executor executor) throws SQLException {
throw new SQLException("Intentional exception during abort"); throw new SQLException("Intentional exception during abort");
} }
/**
* {@inheritDoc}
*/
public void setNetworkTimeout(Executor executor, int milliseconds) throws SQLException { public void setNetworkTimeout(Executor executor, int milliseconds) throws SQLException {
} }
/**
* {@inheritDoc}
*/
public int getNetworkTimeout() throws SQLException { public int getNetworkTimeout() throws SQLException {
if (oldDriver) { if (oldDriver) {
throw new AbstractMethodError(); throw new AbstractMethodError();

View file

@ -36,48 +36,30 @@ public class StubDataSource implements DataSource {
// we don't care // we don't care
} }
/**
* {@inheritDoc}
*/
@Override @Override
public PrintWriter getLogWriter() throws SQLException { public PrintWriter getLogWriter() throws SQLException {
return logWriter; return logWriter;
} }
/**
* {@inheritDoc}
*/
@Override @Override
public void setLogWriter(PrintWriter out) throws SQLException { public void setLogWriter(PrintWriter out) throws SQLException {
this.logWriter = out; this.logWriter = out;
} }
/**
* {@inheritDoc}
*/
@Override @Override
public void setLoginTimeout(int seconds) throws SQLException { public void setLoginTimeout(int seconds) throws SQLException {
this.loginTimeout = seconds; this.loginTimeout = seconds;
} }
/**
* {@inheritDoc}
*/
@Override @Override
public int getLoginTimeout() throws SQLException { public int getLoginTimeout() throws SQLException {
return loginTimeout; return loginTimeout;
} }
/**
* {@inheritDoc}
*/
public Logger getParentLogger() throws SQLFeatureNotSupportedException { public Logger getParentLogger() throws SQLFeatureNotSupportedException {
return null; return null;
} }
/**
* {@inheritDoc}
*/
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
@Override @Override
public <T> T unwrap(Class<T> iface) throws SQLException { public <T> T unwrap(Class<T> iface) throws SQLException {
@ -87,17 +69,11 @@ public class StubDataSource implements DataSource {
throw new SQLException("wrapped DataSource is not an instance of " + iface); throw new SQLException("wrapped DataSource is not an instance of " + iface);
} }
/**
* {@inheritDoc}
*/
@Override @Override
public boolean isWrapperFor(Class<?> iface) throws SQLException { public boolean isWrapperFor(Class<?> iface) throws SQLException {
return false; return false;
} }
/**
* {@inheritDoc}
*/
@Override @Override
public Connection getConnection() throws SQLException { public Connection getConnection() throws SQLException {
if (throwException != null) { if (throwException != null) {
@ -109,9 +85,6 @@ public class StubDataSource implements DataSource {
return new StubConnection(); return new StubConnection();
} }
/**
* {@inheritDoc}
*/
@Override @Override
public Connection getConnection(String username, String password) throws SQLException { public Connection getConnection(String username, String password) throws SQLException {
return new StubConnection(); return new StubConnection();

View file

@ -10,6 +10,7 @@ import java.util.Properties;
import java.util.logging.Logger; import java.util.logging.Logger;
public class StubDriver implements Driver { public class StubDriver implements Driver {
private static final Driver driver; private static final Driver driver;
static { static {
@ -21,57 +22,36 @@ public class StubDriver implements Driver {
} }
} }
/**
* {@inheritDoc}
*/
@Override @Override
public Connection connect(String url, Properties info) throws SQLException { public Connection connect(String url, Properties info) throws SQLException {
return new StubConnection(); return new StubConnection();
} }
/**
* {@inheritDoc}
*/
@Override @Override
public boolean acceptsURL(String url) throws SQLException { public boolean acceptsURL(String url) throws SQLException {
return "jdbc:stub".equals(url); return "jdbc:stub".equals(url);
} }
/**
* {@inheritDoc}
*/
@Override @Override
public DriverPropertyInfo[] getPropertyInfo(String url, Properties info) throws SQLException { public DriverPropertyInfo[] getPropertyInfo(String url, Properties info) throws SQLException {
return null; return null;
} }
/**
* {@inheritDoc}
*/
@Override @Override
public int getMajorVersion() { public int getMajorVersion() {
return 0; return 0;
} }
/**
* {@inheritDoc}
*/
@Override @Override
public int getMinorVersion() { public int getMinorVersion() {
return 0; return 0;
} }
/**
* {@inheritDoc}
*/
@Override @Override
public boolean jdbcCompliant() { public boolean jdbcCompliant() {
return true; return true;
} }
/**
* {@inheritDoc}
*/
public Logger getParentLogger() throws SQLFeatureNotSupportedException { public Logger getParentLogger() throws SQLFeatureNotSupportedException {
return null; return null;
} }

View file

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

View file

@ -23,9 +23,6 @@ public class StubStatement implements Statement {
simulatedQueryTime = time; simulatedQueryTime = time;
} }
/**
* {@inheritDoc}
*/
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
@Override @Override
public <T> T unwrap(Class<T> iface) throws SQLException { public <T> T unwrap(Class<T> iface) throws SQLException {
@ -33,95 +30,62 @@ public class StubStatement implements Statement {
return (T) this; return (T) this;
} }
/**
* {@inheritDoc}
*/
@Override @Override
public boolean isWrapperFor(Class<?> iface) throws SQLException { public boolean isWrapperFor(Class<?> iface) throws SQLException {
checkClosed(); checkClosed();
return false; return false;
} }
/**
* {@inheritDoc}
*/
@Override @Override
public ResultSet executeQuery(String sql) throws SQLException { public ResultSet executeQuery(String sql) throws SQLException {
checkClosed(); checkClosed();
return new StubResultSet(); return new StubResultSet();
} }
/**
* {@inheritDoc}
*/
@Override @Override
public int executeUpdate(String sql) throws SQLException { public int executeUpdate(String sql) throws SQLException {
checkClosed(); checkClosed();
return 0; return 0;
} }
/**
* {@inheritDoc}
*/
@Override @Override
public void close() throws SQLException { public void close() throws SQLException {
closed = true; closed = true;
} }
/**
* {@inheritDoc}
*/
@Override @Override
public int getMaxFieldSize() throws SQLException { public int getMaxFieldSize() throws SQLException {
checkClosed(); checkClosed();
return 0; return 0;
} }
/**
* {@inheritDoc}
*/
@Override @Override
public void setMaxFieldSize(int max) throws SQLException { public void setMaxFieldSize(int max) throws SQLException {
checkClosed(); checkClosed();
} }
/**
* {@inheritDoc}
*/
@Override @Override
public int getMaxRows() throws SQLException { public int getMaxRows() throws SQLException {
checkClosed(); checkClosed();
return 0; return 0;
} }
/**
* {@inheritDoc}
*/
@Override @Override
public void setMaxRows(int max) throws SQLException { public void setMaxRows(int max) throws SQLException {
checkClosed(); checkClosed();
} }
/**
* {@inheritDoc}
*/
@Override @Override
public void setEscapeProcessing(boolean enable) throws SQLException { public void setEscapeProcessing(boolean enable) throws SQLException {
checkClosed(); checkClosed();
} }
/**
* {@inheritDoc}
*/
@Override @Override
public int getQueryTimeout() throws SQLException { public int getQueryTimeout() throws SQLException {
checkClosed(); checkClosed();
return 0; return 0;
} }
/**
* {@inheritDoc}
*/
@Override @Override
public void setQueryTimeout(int seconds) throws SQLException { public void setQueryTimeout(int seconds) throws SQLException {
if (oldDriver) { if (oldDriver) {
@ -131,42 +95,27 @@ public class StubStatement implements Statement {
checkClosed(); checkClosed();
} }
/**
* {@inheritDoc}
*/
@Override @Override
public void cancel() throws SQLException { public void cancel() throws SQLException {
checkClosed(); checkClosed();
} }
/**
* {@inheritDoc}
*/
@Override @Override
public SQLWarning getWarnings() throws SQLException { public SQLWarning getWarnings() throws SQLException {
checkClosed(); checkClosed();
return null; return null;
} }
/**
* {@inheritDoc}
*/
@Override @Override
public void clearWarnings() throws SQLException { public void clearWarnings() throws SQLException {
checkClosed(); checkClosed();
} }
/**
* {@inheritDoc}
*/
@Override @Override
public void setCursorName(String name) throws SQLException { public void setCursorName(String name) throws SQLException {
checkClosed(); checkClosed();
} }
/**
* {@inheritDoc}
*/
@Override @Override
public boolean execute(String sql) throws SQLException { public boolean execute(String sql) throws SQLException {
checkClosed(); checkClosed();
@ -176,235 +125,155 @@ public class StubStatement implements Statement {
return false; return false;
} }
/**
* {@inheritDoc}
*/
@Override @Override
public ResultSet getResultSet() throws SQLException { public ResultSet getResultSet() throws SQLException {
checkClosed(); checkClosed();
return new StubResultSet(); return new StubResultSet();
} }
/**
* {@inheritDoc}
*/
@Override @Override
public int getUpdateCount() throws SQLException { public int getUpdateCount() throws SQLException {
checkClosed(); checkClosed();
return 0; return 0;
} }
/**
* {@inheritDoc}
*/
@Override @Override
public boolean getMoreResults() throws SQLException { public boolean getMoreResults() throws SQLException {
checkClosed(); checkClosed();
return false; return false;
} }
/**
* {@inheritDoc}
*/
@Override @Override
public void setFetchDirection(int direction) throws SQLException { public void setFetchDirection(int direction) throws SQLException {
checkClosed(); checkClosed();
} }
/**
* {@inheritDoc}
*/
@Override @Override
public int getFetchDirection() throws SQLException { public int getFetchDirection() throws SQLException {
checkClosed(); checkClosed();
return 0; return 0;
} }
/**
* {@inheritDoc}
*/
@Override @Override
public void setFetchSize(int rows) throws SQLException { public void setFetchSize(int rows) throws SQLException {
checkClosed(); checkClosed();
} }
/**
* {@inheritDoc}
*/
@Override @Override
public int getFetchSize() throws SQLException { public int getFetchSize() throws SQLException {
checkClosed(); checkClosed();
return 0; return 0;
} }
/**
* {@inheritDoc}
*/
@Override @Override
public int getResultSetConcurrency() throws SQLException { public int getResultSetConcurrency() throws SQLException {
checkClosed(); checkClosed();
return 0; return 0;
} }
/**
* {@inheritDoc}
*/
@Override @Override
public int getResultSetType() throws SQLException { public int getResultSetType() throws SQLException {
checkClosed(); checkClosed();
return 0; return 0;
} }
/**
* {@inheritDoc}
*/
@Override @Override
public void addBatch(String sql) throws SQLException { public void addBatch(String sql) throws SQLException {
checkClosed(); checkClosed();
} }
/**
* {@inheritDoc}
*/
@Override @Override
public void clearBatch() throws SQLException { public void clearBatch() throws SQLException {
checkClosed(); checkClosed();
} }
/**
* {@inheritDoc}
*/
@Override @Override
public int[] executeBatch() throws SQLException { public int[] executeBatch() throws SQLException {
checkClosed(); checkClosed();
return null; return null;
} }
/**
* {@inheritDoc}
*/
@Override @Override
public Connection getConnection() throws SQLException { public Connection getConnection() throws SQLException {
checkClosed(); checkClosed();
return connection; return connection;
} }
/**
* {@inheritDoc}
*/
@Override @Override
public boolean getMoreResults(int current) throws SQLException { public boolean getMoreResults(int current) throws SQLException {
checkClosed(); checkClosed();
return false; return false;
} }
/**
* {@inheritDoc}
*/
@Override @Override
public ResultSet getGeneratedKeys() throws SQLException { public ResultSet getGeneratedKeys() throws SQLException {
checkClosed(); checkClosed();
return new StubResultSet(); return new StubResultSet();
} }
/**
* {@inheritDoc}
*/
@Override @Override
public int executeUpdate(String sql, int autoGeneratedKeys) throws SQLException { public int executeUpdate(String sql, int autoGeneratedKeys) throws SQLException {
checkClosed(); checkClosed();
return 0; return 0;
} }
/**
* {@inheritDoc}
*/
@Override @Override
public int executeUpdate(String sql, int[] columnIndexes) throws SQLException { public int executeUpdate(String sql, int[] columnIndexes) throws SQLException {
checkClosed(); checkClosed();
return 0; return 0;
} }
/**
* {@inheritDoc}
*/
@Override @Override
public int executeUpdate(String sql, String[] columnNames) throws SQLException { public int executeUpdate(String sql, String[] columnNames) throws SQLException {
checkClosed(); checkClosed();
return 0; return 0;
} }
/**
* {@inheritDoc}
*/
@Override @Override
public boolean execute(String sql, int autoGeneratedKeys) throws SQLException { public boolean execute(String sql, int autoGeneratedKeys) throws SQLException {
checkClosed(); checkClosed();
return false; return false;
} }
/**
* {@inheritDoc}
*/
@Override @Override
public boolean execute(String sql, int[] columnIndexes) throws SQLException { public boolean execute(String sql, int[] columnIndexes) throws SQLException {
checkClosed(); checkClosed();
return false; return false;
} }
/**
* {@inheritDoc}
*/
@Override @Override
public boolean execute(String sql, String[] columnNames) throws SQLException { public boolean execute(String sql, String[] columnNames) throws SQLException {
checkClosed(); checkClosed();
return false; return false;
} }
/**
* {@inheritDoc}
*/
@Override @Override
public int getResultSetHoldability() throws SQLException { public int getResultSetHoldability() throws SQLException {
checkClosed(); checkClosed();
return 0; return 0;
} }
/**
* {@inheritDoc}
*/
@Override @Override
public boolean isClosed() throws SQLException { public boolean isClosed() throws SQLException {
return closed; return closed;
} }
/**
* {@inheritDoc}
*/
@Override @Override
public void setPoolable(boolean poolable) throws SQLException { public void setPoolable(boolean poolable) throws SQLException {
checkClosed(); checkClosed();
} }
/**
* {@inheritDoc}
*/
@Override @Override
public boolean isPoolable() throws SQLException { public boolean isPoolable() throws SQLException {
checkClosed(); checkClosed();
return false; return false;
} }
/**
* {@inheritDoc}
*/
public void closeOnCompletion() throws SQLException { public void closeOnCompletion() throws SQLException {
checkClosed(); checkClosed();
} }
/** @Override
* {@inheritDoc}
*/
public boolean isCloseOnCompletion() throws SQLException { public boolean isCloseOnCompletion() throws SQLException {
checkClosed(); checkClosed();
return false; return false;

View file

@ -29,6 +29,9 @@ public class Schema {
private String userTableName = "user_principal"; private String userTableName = "user_principal";
public Schema() {
}
public Sequence addSequence(String name) { public Sequence addSequence(String name) {
Sequence sequence = new Sequence(name); Sequence sequence = new Sequence(name);
sequences.add(sequence); sequences.add(sequence);

View file

@ -19,8 +19,12 @@ import java.util.Set;
* various arg*() calls and replay them later via the apply(sqlArgs) methods. * various arg*() calls and replay them later via the apply(sqlArgs) methods.
*/ */
public class SqlArgs implements SqlInsert.Apply, SqlUpdate.Apply, SqlSelect.Apply { public class SqlArgs implements SqlInsert.Apply, SqlUpdate.Apply, SqlSelect.Apply {
private final List<Invocation> invocations = new ArrayList<>(); private final List<Invocation> invocations = new ArrayList<>();
public SqlArgs() {
}
public static Builder fromMetadata(Row r) { public static Builder fromMetadata(Row r) {
return new Builder(r); return new Builder(r);
} }

View file

@ -5,9 +5,14 @@ package org.xbib.jdbc.query;
* in terms of commit/rollback. * in terms of commit/rollback.
*/ */
public class TransactionImpl implements Transaction { public class TransactionImpl implements Transaction {
private boolean rollbackOnError; private boolean rollbackOnError;
private boolean rollbackOnly; private boolean rollbackOnly;
public TransactionImpl() {
}
@Override @Override
public boolean isRollbackOnError() { public boolean isRollbackOnError() {
return rollbackOnError; return rollbackOnError;