//============================================================================== // StatementAdapter.java //============================================================================== package tribble.sql; import java.lang.UnsupportedOperationException; import java.sql.Connection; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.SQLWarning; import java.sql.Statement; /******************************************************************************* * JDBC statement adapter class. * Provides all the methods required by the java.sql.Statement class, * most of which do nothing but throw an UnsupportedOperationException. * Subclasses that extend this base class can then implement only the methods * that they need. * * *
*
Source code:
*
Available at: * http://david.tribble.com/src/java/tribble/sql/StatementAdapter.java *
*
Documentation:
*
Available at: * http://david.tribble.com/docs/tribble/sql/StatementAdapter.html *
*
* * @version @(#)$Revision: 1.2 $ $Date: 2008/09/06 17:49:07 $ * @since 2008-09-04 * @author David R. Tribble (david@tribble.com) *

* Copyright ©2008 by David R. Tribble, all rights reserved.
* Permission is granted to any person or entity except those designated by * by the United States Department of State as a terrorist, or terrorist * government or agency, to use and distribute this source code provided * that the original copyright notice remains present and unaltered. * * @see ResultSetAdapter */ public class StatementAdapter implements java.sql.Statement { static final String REV = "@(#)tribble/sql/StatementAdapter.java $Revision: 1.2 $ $Date: 2008/09/06 17:49:07 $\n"; // ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ // Constants /** Constant indicating that all ResultSet objects that have * previously been kept open should be closed when calling * {@link #getMoreResults getMoreResults()}. */ public static final int CLOSE_ALL_RESULTS = 1; /** Constant indicating that the current ResultSet object should be * closed when calling {@link #getMoreResults getMoreResults()}. */ public static final int CLOSE_CURRENT_RESULT = 2; /** Constant indicating that the current ResultSet object should * not be closed when calling {@link #getMoreResults getMoreResults()}. */ public static final int KEEP_CURRENT_RESULT = 3; /** Constant indicating that an error occured while executing a batch * statement. */ public static final int EXECUTE_FAILED = 10; /** Constant indicating that generated keys should not be made available for * retrieval. */ public static final int NO_GENERATED_KEYS = 20; /** Constant indicating that generated keys should be made available for * retrieval. */ public static final int RETURN_GENERATED_KEYS = 21; /** Constant indicating that a batch statement executed successfully but * that no count of the number of rows it affected is available. */ public static final int SUCCESS_NO_INFO = 30; // ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ // Variables /** JDBC connection that created this statement. */ private Connection m_conn; // ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ // Constructors /*************************************************************************** * Constructor. * * @since 1.1, 2008-09-02 */ public StatementAdapter(Connection conn) { m_conn = conn; } // ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ // Methods public void close() throws SQLException { } public ResultSet executeQuery(String stmt) throws SQLException { throw new UnsupportedOperationException("Not implemented"); } public boolean execute(String stmt) throws SQLException { throw new UnsupportedOperationException("Not implemented"); } public boolean execute(String stmt, String[] parms) throws SQLException { throw new UnsupportedOperationException("Not implemented"); } public boolean execute(String stmt, int parm) throws SQLException { throw new UnsupportedOperationException("Not implemented"); } public boolean execute(String stmt, int[] parms) throws SQLException { throw new UnsupportedOperationException("Not implemented"); } public int executeUpdate(String stmt) throws SQLException { throw new UnsupportedOperationException("Not implemented"); } public int executeUpdate(String stmt, String[] parms) throws SQLException { throw new UnsupportedOperationException("Not implemented"); } public int executeUpdate(String stmt, int parm) throws SQLException { throw new UnsupportedOperationException("Not implemented"); } public int executeUpdate(String stmt, int[] parms) throws SQLException { throw new UnsupportedOperationException("Not implemented"); } public int[] executeBatch() throws SQLException { throw new UnsupportedOperationException("Not implemented"); } public ResultSet getResultSet() throws SQLException { throw new UnsupportedOperationException("Not implemented"); } public boolean getMoreResults() throws SQLException { throw new UnsupportedOperationException("Not implemented"); } public boolean getMoreResults(int n) throws SQLException { throw new UnsupportedOperationException("Not implemented"); } public int getResultSetType() throws SQLException { throw new UnsupportedOperationException("Not implemented"); } public int getResultSetHoldability() throws SQLException { throw new UnsupportedOperationException("Not implemented"); } public int getResultSetConcurrency() throws SQLException { throw new UnsupportedOperationException("Not implemented"); } public Connection getConnection() { return m_conn; } public SQLWarning getWarnings() throws SQLException { throw new UnsupportedOperationException("Not implemented"); } public void clearWarnings() throws SQLException { } public ResultSet getGeneratedKeys() throws SQLException { throw new UnsupportedOperationException("Not implemented"); } public int getQueryTimeout() throws SQLException { throw new UnsupportedOperationException("Not implemented"); } public void setCursorName(String s) throws SQLException { throw new UnsupportedOperationException("Not implemented"); } public void addBatch(String s) throws SQLException { throw new UnsupportedOperationException("Not implemented"); } public void clearBatch() throws SQLException { throw new UnsupportedOperationException("Not implemented"); } public void setEscapeProcessing(boolean f) throws SQLException { throw new UnsupportedOperationException("Not implemented"); } public int getMaxRows() throws SQLException { throw new UnsupportedOperationException("Not implemented"); } public void setMaxRows(int n) throws SQLException { throw new UnsupportedOperationException("Not implemented"); } public int getMaxFieldSize() throws SQLException { throw new UnsupportedOperationException("Not implemented"); } public void setMaxFieldSize(int n) throws SQLException { throw new UnsupportedOperationException("Not implemented"); } public int getFetchSize() throws SQLException { throw new UnsupportedOperationException("Not implemented"); } public void setFetchSize(int n) throws SQLException { throw new UnsupportedOperationException("Not implemented"); } public int getFetchDirection() throws SQLException { throw new UnsupportedOperationException("Not implemented"); } public void setFetchDirection(int n) throws SQLException { throw new UnsupportedOperationException("Not implemented"); } public void setQueryTimeout(int n) throws SQLException { throw new UnsupportedOperationException("Not implemented"); } public void cancel() throws SQLException { throw new UnsupportedOperationException("Not implemented"); } public int getUpdateCount() throws SQLException { throw new UnsupportedOperationException("Not implemented"); } } // End StatementAdapter.java