Repository: commons-dbcp Updated Branches: refs/heads/master f2e00c045 -> 37daf894a
Sort members in AB order so it's easier to find stuff. Project: http://git-wip-us.apache.org/repos/asf/commons-dbcp/repo Commit: http://git-wip-us.apache.org/repos/asf/commons-dbcp/commit/37daf894 Tree: http://git-wip-us.apache.org/repos/asf/commons-dbcp/tree/37daf894 Diff: http://git-wip-us.apache.org/repos/asf/commons-dbcp/diff/37daf894 Branch: refs/heads/master Commit: 37daf894acfcb89582e701a36e1695f772fee3a4 Parents: f2e00c0 Author: Gary Gregory <garydgreg...@gmail.com> Authored: Sun Jun 17 08:53:38 2018 -0600 Committer: Gary Gregory <garydgreg...@gmail.com> Committed: Sun Jun 17 08:53:38 2018 -0600 ---------------------------------------------------------------------- .../commons/dbcp2/TesterPreparedStatement.java | 276 +++++++++---------- 1 file changed, 138 insertions(+), 138 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/commons-dbcp/blob/37daf894/src/test/java/org/apache/commons/dbcp2/TesterPreparedStatement.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/dbcp2/TesterPreparedStatement.java b/src/test/java/org/apache/commons/dbcp2/TesterPreparedStatement.java index 814797b..292ecb9 100644 --- a/src/test/java/org/apache/commons/dbcp2/TesterPreparedStatement.java +++ b/src/test/java/org/apache/commons/dbcp2/TesterPreparedStatement.java @@ -86,10 +86,9 @@ public class TesterPreparedStatement extends TesterStatement implements Prepared } } - public TesterPreparedStatement(final Connection conn, final String sql, final String columnNames[]) { - super(conn); + public TesterPreparedStatement(final Connection conn, final String sql, final int resultSetType, final int resultSetConcurrency) { + super(conn, resultSetType, resultSetConcurrency); _sql = sql; - _columnNames = columnNames; try { _catalog = conn.getCatalog(); } catch (final SQLException e) { @@ -97,8 +96,9 @@ public class TesterPreparedStatement extends TesterStatement implements Prepared } } - public TesterPreparedStatement(final Connection conn, final String sql, final int resultSetType, final int resultSetConcurrency) { - super(conn, resultSetType, resultSetConcurrency); + public TesterPreparedStatement(final Connection conn, final String sql, final int resultSetType, final int resultSetConcurrency, + final int resultSetHoldability) { + super(conn, resultSetType, resultSetConcurrency, resultSetHoldability); _sql = sql; try { _catalog = conn.getCatalog(); @@ -107,10 +107,10 @@ public class TesterPreparedStatement extends TesterStatement implements Prepared } } - public TesterPreparedStatement(final Connection conn, final String sql, final int resultSetType, final int resultSetConcurrency, - final int resultSetHoldability) { - super(conn, resultSetType, resultSetConcurrency, resultSetHoldability); + public TesterPreparedStatement(final Connection conn, final String sql, final String columnNames[]) { + super(conn); _sql = sql; + _columnNames = columnNames; try { _catalog = conn.getCatalog(); } catch (final SQLException e) { @@ -118,40 +118,37 @@ public class TesterPreparedStatement extends TesterStatement implements Prepared } } - /** for junit test only */ - public String getSql() { - return _sql; - } - - public String getCatalog() { - return _catalog; + @Override + public void addBatch() throws SQLException { + checkOpen(); } - public int getAutoGeneratedKeys() { - return _autoGeneratedKeys; + @Override + public void clearParameters() throws SQLException { + checkOpen(); } - public int[] getColumnIndexes() { - return _columnIndexes; + @Override + public boolean execute() throws SQLException { + checkOpen(); return true; } - public String[] getColumnNames() { - return _columnNames; + @Override + public boolean execute(final String sql, final int autoGeneratedKeys) throws SQLException { + checkOpen(); + return true; } @Override - public ResultSet executeQuery(final String sql) throws SQLException { + public boolean execute(final String sl, final int columnIndexes[]) throws SQLException { checkOpen(); - if("null".equals(sql)) { - return null; - } - return new TesterResultSet(this, _resultSetType, _resultSetConcurrency); + return true; } @Override - public int executeUpdate(final String sql) throws SQLException { + public boolean execute(final String sql, final String columnNames[]) throws SQLException { checkOpen(); - return _rowsUpdated; + return true; } @Override @@ -168,239 +165,240 @@ public class TesterPreparedStatement extends TesterStatement implements Prepared } @Override - public int executeUpdate() throws SQLException { + public ResultSet executeQuery(final String sql) throws SQLException { checkOpen(); - return _rowsUpdated; + if("null".equals(sql)) { + return null; + } + return new TesterResultSet(this, _resultSetType, _resultSetConcurrency); } @Override - public void setNull(final int parameterIndex, final int sqlType) throws SQLException { + public int executeUpdate() throws SQLException { checkOpen(); + return _rowsUpdated; } @Override - public void setBoolean(final int parameterIndex, final boolean x) throws SQLException { + public int executeUpdate(final String sql) throws SQLException { checkOpen(); + return _rowsUpdated; } @Override - public void setByte(final int parameterIndex, final byte x) throws SQLException { + public int executeUpdate(final String sql, final int autoGeneratedKeys) throws SQLException { checkOpen(); + return 0; } @Override - public void setShort(final int parameterIndex, final short x) throws SQLException { + public int executeUpdate(final String sql, final int columnIndexes[]) throws SQLException { checkOpen(); + return 0; } @Override - public void setInt(final int parameterIndex, final int x) throws SQLException { + public int executeUpdate(final String sql, final String columnNames[]) throws SQLException { checkOpen(); + return 0; } - @Override - public void setLong(final int parameterIndex, final long x) throws SQLException { - checkOpen(); + public int getAutoGeneratedKeys() { + return _autoGeneratedKeys; } - @Override - public void setFloat(final int parameterIndex, final float x) throws SQLException { - checkOpen(); + public String getCatalog() { + return _catalog; } - @Override - public void setDouble(final int parameterIndex, final double x) throws SQLException { - checkOpen(); + public int[] getColumnIndexes() { + return _columnIndexes; } - @Override - public void setBigDecimal(final int parameterIndex, final BigDecimal x) throws SQLException { - checkOpen(); + public String[] getColumnNames() { + return _columnNames; } @Override - public void setString(final int parameterIndex, final String x) throws SQLException { - checkOpen(); + public ResultSet getGeneratedKeys() throws SQLException { + return new TesterResultSet(this, _resultSetType, _resultSetConcurrency); } @Override - public void setBytes(final int parameterIndex, final byte x[]) throws SQLException { + public ResultSetMetaData getMetaData() throws SQLException { checkOpen(); + return _resultSetMetaData; } @Override - public void setDate(final int parameterIndex, final java.sql.Date x) throws SQLException { - checkOpen(); + public boolean getMoreResults(final int current) throws SQLException { + throw new SQLException("Not implemented."); } @Override - public void setTime(final int parameterIndex, final java.sql.Time x) throws SQLException { - checkOpen(); + public java.sql.ParameterMetaData getParameterMetaData() throws SQLException { + throw new SQLException("Not implemented."); } - @Override - public void setTimestamp(final int parameterIndex, final java.sql.Timestamp x) throws SQLException { - checkOpen(); + /** for junit test only */ + public String getSql() { + return _sql; } @Override - public void setAsciiStream(final int parameterIndex, final java.io.InputStream x, final int length) throws SQLException { + public void setArray (final int i, final Array x) throws SQLException { checkOpen(); } - /** @deprecated */ - @Deprecated @Override - public void setUnicodeStream(final int parameterIndex, final java.io.InputStream x, final int length) throws SQLException { - checkOpen(); + public void setAsciiStream(final int parameterIndex, final InputStream inputStream) throws SQLException { + throw new SQLException("Not implemented."); } @Override - public void setBinaryStream(final int parameterIndex, final java.io.InputStream x, final int length) throws SQLException { - checkOpen(); + public void setAsciiStream(final int parameterIndex, final InputStream inputStream, final long length) throws SQLException { + throw new SQLException("Not implemented."); } @Override - public void clearParameters() throws SQLException { + public void setAsciiStream(final int parameterIndex, final java.io.InputStream x, final int length) throws SQLException { checkOpen(); } @Override - public void setObject(final int parameterIndex, final Object x, final int targetSqlType, final int scale) throws SQLException { + public void setBigDecimal(final int parameterIndex, final BigDecimal x) throws SQLException { checkOpen(); } @Override - public void setObject(final int parameterIndex, final Object x, final int targetSqlType) throws SQLException { - checkOpen(); + public void setBinaryStream(final int parameterIndex, final InputStream inputStream) throws SQLException { + throw new SQLException("Not implemented."); } @Override - public void setObject(final int parameterIndex, final Object x) throws SQLException { - checkOpen(); + public void setBinaryStream(final int parameterIndex, final InputStream inputStream, final long length) throws SQLException { + throw new SQLException("Not implemented."); } - @Override - public boolean execute() throws SQLException { - checkOpen(); return true; + public void setBinaryStream(final int parameterIndex, final java.io.InputStream x, final int length) throws SQLException { + checkOpen(); } + @Override - public void addBatch() throws SQLException { + public void setBlob (final int i, final Blob x) throws SQLException { checkOpen(); } @Override - public void setCharacterStream(final int parameterIndex, final java.io.Reader reader, final int length) throws SQLException { - checkOpen(); + public void setBlob(final int parameterIndex, final InputStream inputStream) throws SQLException { + throw new SQLException("Not implemented."); } @Override - public void setRef (final int i, final Ref x) throws SQLException { - checkOpen(); + public void setBlob(final int parameterIndex, final InputStream inputStream, final long length) throws SQLException { + throw new SQLException("Not implemented."); } @Override - public void setBlob (final int i, final Blob x) throws SQLException { + public void setBoolean(final int parameterIndex, final boolean x) throws SQLException { checkOpen(); } @Override - public void setClob (final int i, final Clob x) throws SQLException { + public void setByte(final int parameterIndex, final byte x) throws SQLException { checkOpen(); } @Override - public void setArray (final int i, final Array x) throws SQLException { + public void setBytes(final int parameterIndex, final byte x[]) throws SQLException { checkOpen(); } @Override - public ResultSetMetaData getMetaData() throws SQLException { + public void setCharacterStream(final int parameterIndex, final java.io.Reader reader, final int length) throws SQLException { checkOpen(); - return _resultSetMetaData; } @Override - public void setDate(final int parameterIndex, final java.sql.Date x, final Calendar cal) throws SQLException { - checkOpen(); + public void setCharacterStream(final int parameterIndex, final Reader reader) throws SQLException { + throw new SQLException("Not implemented."); } @Override - public void setTime(final int parameterIndex, final java.sql.Time x, final Calendar cal) throws SQLException { - checkOpen(); + public void setCharacterStream(final int parameterIndex, final Reader reader, final long length) throws SQLException { + throw new SQLException("Not implemented."); } @Override - public void setTimestamp(final int parameterIndex, final java.sql.Timestamp x, final Calendar cal) throws SQLException { + public void setClob (final int i, final Clob x) throws SQLException { checkOpen(); } @Override - public void setNull (final int paramIndex, final int sqlType, final String typeName) throws SQLException { - checkOpen(); + public void setClob(final int parameterIndex, final Reader reader) throws SQLException { + throw new SQLException("Not implemented."); } @Override - public boolean getMoreResults(final int current) throws SQLException { + public void setClob(final int parameterIndex, final Reader reader, final long length) throws SQLException { throw new SQLException("Not implemented."); } @Override - public ResultSet getGeneratedKeys() throws SQLException { - return new TesterResultSet(this, _resultSetType, _resultSetConcurrency); + public void setDate(final int parameterIndex, final java.sql.Date x) throws SQLException { + checkOpen(); } @Override - public int executeUpdate(final String sql, final int autoGeneratedKeys) throws SQLException { + public void setDate(final int parameterIndex, final java.sql.Date x, final Calendar cal) throws SQLException { checkOpen(); - return 0; } @Override - public int executeUpdate(final String sql, final int columnIndexes[]) throws SQLException { + public void setDouble(final int parameterIndex, final double x) throws SQLException { checkOpen(); - return 0; } @Override - public int executeUpdate(final String sql, final String columnNames[]) throws SQLException { + public void setFloat(final int parameterIndex, final float x) throws SQLException { checkOpen(); - return 0; } @Override - public boolean execute(final String sql, final int autoGeneratedKeys) throws SQLException { + public void setInt(final int parameterIndex, final int x) throws SQLException { checkOpen(); - return true; } @Override - public boolean execute(final String sl, final int columnIndexes[]) throws SQLException { + public void setLong(final int parameterIndex, final long x) throws SQLException { checkOpen(); - return true; } @Override - public boolean execute(final String sql, final String columnNames[]) throws SQLException { - checkOpen(); - return true; + public void setNCharacterStream(final int parameterIndex, final Reader reader) throws SQLException { + throw new SQLException("Not implemented."); } @Override - public void setURL(final int parameterIndex, final java.net.URL x) throws SQLException { + public void setNCharacterStream(final int parameterIndex, final Reader value, final long length) throws SQLException { throw new SQLException("Not implemented."); } @Override - public java.sql.ParameterMetaData getParameterMetaData() throws SQLException { + public void setNClob(final int parameterIndex, final NClob value) throws SQLException { + throw new SQLException("Not implemented."); + } + + @Override + public void setNClob(final int parameterIndex, final Reader reader) throws SQLException { throw new SQLException("Not implemented."); } @Override - public void setRowId(final int parameterIndex, final RowId value) throws SQLException { + public void setNClob(final int parameterIndex, final Reader reader, final long length) throws SQLException { throw new SQLException("Not implemented."); } @@ -410,82 +408,84 @@ public class TesterPreparedStatement extends TesterStatement implements Prepared } @Override - public void setNCharacterStream(final int parameterIndex, final Reader value, final long length) throws SQLException { - throw new SQLException("Not implemented."); + public void setNull(final int parameterIndex, final int sqlType) throws SQLException { + checkOpen(); } @Override - public void setNClob(final int parameterIndex, final NClob value) throws SQLException { - throw new SQLException("Not implemented."); + public void setNull (final int paramIndex, final int sqlType, final String typeName) throws SQLException { + checkOpen(); } @Override - public void setClob(final int parameterIndex, final Reader reader, final long length) throws SQLException { - throw new SQLException("Not implemented."); + public void setObject(final int parameterIndex, final Object x) throws SQLException { + checkOpen(); } @Override - public void setBlob(final int parameterIndex, final InputStream inputStream, final long length) throws SQLException { - throw new SQLException("Not implemented."); + public void setObject(final int parameterIndex, final Object x, final int targetSqlType) throws SQLException { + checkOpen(); } @Override - public void setNClob(final int parameterIndex, final Reader reader, final long length) throws SQLException { - throw new SQLException("Not implemented."); + public void setObject(final int parameterIndex, final Object x, final int targetSqlType, final int scale) throws SQLException { + checkOpen(); } @Override - public void setSQLXML(final int parameterIndex, final SQLXML value) throws SQLException { - throw new SQLException("Not implemented."); + public void setRef (final int i, final Ref x) throws SQLException { + checkOpen(); } @Override - public void setAsciiStream(final int parameterIndex, final InputStream inputStream, final long length) throws SQLException { + public void setRowId(final int parameterIndex, final RowId value) throws SQLException { throw new SQLException("Not implemented."); } @Override - public void setBinaryStream(final int parameterIndex, final InputStream inputStream, final long length) throws SQLException { - throw new SQLException("Not implemented."); + public void setShort(final int parameterIndex, final short x) throws SQLException { + checkOpen(); } @Override - public void setCharacterStream(final int parameterIndex, final Reader reader, final long length) throws SQLException { + public void setSQLXML(final int parameterIndex, final SQLXML value) throws SQLException { throw new SQLException("Not implemented."); } @Override - public void setAsciiStream(final int parameterIndex, final InputStream inputStream) throws SQLException { - throw new SQLException("Not implemented."); + public void setString(final int parameterIndex, final String x) throws SQLException { + checkOpen(); } @Override - public void setBinaryStream(final int parameterIndex, final InputStream inputStream) throws SQLException { - throw new SQLException("Not implemented."); + public void setTime(final int parameterIndex, final java.sql.Time x) throws SQLException { + checkOpen(); } @Override - public void setCharacterStream(final int parameterIndex, final Reader reader) throws SQLException { - throw new SQLException("Not implemented."); + public void setTime(final int parameterIndex, final java.sql.Time x, final Calendar cal) throws SQLException { + checkOpen(); } @Override - public void setNCharacterStream(final int parameterIndex, final Reader reader) throws SQLException { - throw new SQLException("Not implemented."); + public void setTimestamp(final int parameterIndex, final java.sql.Timestamp x) throws SQLException { + checkOpen(); } @Override - public void setClob(final int parameterIndex, final Reader reader) throws SQLException { - throw new SQLException("Not implemented."); + public void setTimestamp(final int parameterIndex, final java.sql.Timestamp x, final Calendar cal) throws SQLException { + checkOpen(); } + /** @deprecated */ + @Deprecated @Override - public void setBlob(final int parameterIndex, final InputStream inputStream) throws SQLException { - throw new SQLException("Not implemented."); + public void setUnicodeStream(final int parameterIndex, final java.io.InputStream x, final int length) throws SQLException { + checkOpen(); } @Override - public void setNClob(final int parameterIndex, final Reader reader) throws SQLException { + public void setURL(final int parameterIndex, final java.net.URL x) throws SQLException { throw new SQLException("Not implemented."); }