From: Jeff M. <cus...@us...> - 2002-06-28 17:35:42
|
Update of /cvsroot/mockobjects/mockobjects-java/src/jdk/1.4/com/mockobjects/sql In directory usw-pr-cvs1:/tmp/cvs-serv21660/src/jdk/1.4/com/mockobjects/sql Added Files: MockConnection.java MockMultiRowResultSet.java MockPreparedStatement.java MockResultSetMetaData.java MockSingleRowResultSet.java MockStatement.java Log Message: Added abstraction layer to sql mocks to allow build against jdk1.4 --- NEW FILE: MockConnection.java --- package com.mockobjects.sql; import java.sql.*; public class MockConnection extends CommonMockConnection{ public void setHoldability(int holdability) throws SQLException { notImplemented(); } public int getHoldability() throws SQLException { notImplemented(); return 0; } public Savepoint setSavepoint() throws SQLException { notImplemented(); return null; } public Savepoint setSavepoint(String name) throws SQLException { notImplemented(); return null; } public void rollback(Savepoint savepoint) throws SQLException { notImplemented(); } public void releaseSavepoint(Savepoint savepoint) throws SQLException { notImplemented(); } public Statement createStatement(int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException { notImplemented(); return null; } public PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException { notImplemented(); return null; } public CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException { notImplemented(); return null; } public PreparedStatement prepareStatement(String sql, int autoGeneratedKeys) throws SQLException { notImplemented(); return null; } public PreparedStatement prepareStatement(String sql, int columnIndexes[]) throws SQLException { notImplemented(); return null; } public PreparedStatement prepareStatement(String sql, String columnNames[]) throws SQLException { notImplemented(); return null; } } --- NEW FILE: MockMultiRowResultSet.java --- package com.mockobjects.sql; import java.net.URL; import java.sql.*; import java.sql.SQLException; import java.sql.Ref; import java.sql.Blob; import java.sql.Clob; public class MockMultiRowResultSet extends CommonMockMultiRowResultSet{ public URL getURL(int columnIndex) throws SQLException { notImplemented(); return null; } public URL getURL(String columnName) throws SQLException { notImplemented(); return null; } public void updateRef(int columnIndex, Ref x) throws SQLException { notImplemented(); } public void updateRef(String columnName, Ref x) throws SQLException { notImplemented(); } public void updateBlob(int columnIndex, Blob x) throws SQLException { notImplemented(); } public void updateBlob(String columnName, Blob x) throws SQLException { notImplemented(); } public void updateClob(int columnIndex, Clob x) throws SQLException { notImplemented(); } public void updateClob(String columnName, Clob x) throws SQLException { notImplemented(); } public void updateArray(int columnIndex, Array x) throws SQLException { notImplemented(); } public void updateArray(String columnName, Array x) throws SQLException { notImplemented(); } } --- NEW FILE: MockPreparedStatement.java --- package com.mockobjects.sql; import java.sql.SQLException; import java.sql.ResultSet; import java.sql.ParameterMetaData; import java.net.URL; public class MockPreparedStatement extends CommonMockPreparedStatement { public boolean getMoreResults(int current) throws SQLException { notImplemented(); return false; } public void setURL(int parameterIndex, URL x) throws SQLException { notImplemented(); } public ResultSet getGeneratedKeys() throws SQLException { notImplemented(); return null; } public ParameterMetaData getParameterMetaData() throws SQLException { notImplemented(); return null; } public int executeUpdate(String sql, int autoGeneratedKeys) throws SQLException { notImplemented(); return 0; } public int executeUpdate(String sql, int columnIndexes[]) throws SQLException { notImplemented(); return 0; } public int executeUpdate(String sql, String columnNames[]) throws SQLException { notImplemented(); return 0; } public boolean execute(String sql, int autoGeneratedKeys) throws SQLException { notImplemented(); return false; } public boolean execute(String sql, int columnIndexes[]) throws SQLException { notImplemented(); return false; } public boolean execute(String sql, String columnNames[]) throws SQLException { notImplemented(); return false; } public int getResultSetHoldability() throws SQLException { notImplemented(); return 0; } } --- NEW FILE: MockResultSetMetaData.java --- package com.mockobjects.sql; import com.mockobjects.*; import java.sql.*; import java.sql.SQLException; import java.util.Vector; public class MockResultSetMetaData extends MockObject implements ResultSetMetaData { private ReturnObjectList myNames = new ReturnObjectList("column names"); private int myColumnCount; public void setupGetColumnCount(int aColumnCount){ myColumnCount = aColumnCount; } /** * @see ResultSetMetaData#getColumnCount() */ public int getColumnCount() throws SQLException { return myColumnCount; } /** * @see ResultSetMetaData#isAutoIncrement(int) */ public boolean isAutoIncrement(int arg0) throws SQLException { notImplemented(); return false; } /** * @see ResultSetMetaData#isCaseSensitive(int) */ public boolean isCaseSensitive(int arg0) throws SQLException { notImplemented(); return false; } /** * @see ResultSetMetaData#isSearchable(int) */ public boolean isSearchable(int arg0) throws SQLException { notImplemented(); return false; } /** * @see ResultSetMetaData#isCurrency(int) */ public boolean isCurrency(int arg0) throws SQLException { notImplemented(); return false; } /** * @see ResultSetMetaData#isNullable(int) */ public int isNullable(int arg0) throws SQLException { notImplemented(); return 0; } /** * @see ResultSetMetaData#isSigned(int) */ public boolean isSigned(int arg0) throws SQLException { notImplemented(); return false; } /** * @see ResultSetMetaData#getColumnDisplaySize(int) */ public int getColumnDisplaySize(int arg0) throws SQLException { notImplemented(); return 0; } /** * @see ResultSetMetaData#getColumnLabel(int) */ public String getColumnLabel(int arg0) throws SQLException { notImplemented(); return null; } public void setupAddColumnNames(String[] allNames) { if (allNames != null) { for (int i = 0; i < allNames.length; i++) { setupAddColumnName(allNames[i]); } } } public void setupAddColumnName(String aName){ this.myNames.addObjectToReturn(aName); } /** * @see ResultSetMetaData#getColumnName(int) */ public String getColumnName(int aColumnIndex) throws SQLException { return (String)myNames.nextReturnObject(); } /** * @see ResultSetMetaData#getSchemaName(int) */ public String getSchemaName(int arg0) throws SQLException { notImplemented(); return null; } /** * @see ResultSetMetaData#getPrecision(int) */ public int getPrecision(int arg0) throws SQLException { notImplemented(); return 0; } /** * @see ResultSetMetaData#getScale(int) */ public int getScale(int arg0) throws SQLException { notImplemented(); return 0; } /** * @see ResultSetMetaData#getTableName(int) */ public String getTableName(int arg0) throws SQLException { notImplemented(); return null; } /** * @see ResultSetMetaData#getCatalogName(int) */ public String getCatalogName(int arg0) throws SQLException { notImplemented(); return null; } /** * @see ResultSetMetaData#getColumnType(int) */ public int getColumnType(int arg0) throws SQLException { notImplemented(); return 0; } /** * @see ResultSetMetaData#getColumnTypeName(int) */ public String getColumnTypeName(int arg0) throws SQLException { notImplemented(); return null; } /** * @see ResultSetMetaData#isReadOnly(int) */ public boolean isReadOnly(int arg0) throws SQLException { notImplemented(); return false; } /** * @see ResultSetMetaData#isWritable(int) */ public boolean isWritable(int arg0) throws SQLException { notImplemented(); return false; } /** * @see ResultSetMetaData#isDefinitelyWritable(int) */ public boolean isDefinitelyWritable(int arg0) throws SQLException { notImplemented(); return false; } /** * @see ResultSetMetaData#getColumnClassName(int) */ public String getColumnClassName(int arg0) throws SQLException { notImplemented(); return null; } } --- NEW FILE: MockSingleRowResultSet.java --- package com.mockobjects.sql; import java.net.URL; import java.sql.*; public class MockSingleRowResultSet extends CommonMockSingleRowResultSet { public URL getURL(int columnIndex) throws SQLException { notImplemented(); return null; } public URL getURL(String columnName) throws SQLException { notImplemented(); return null; } public void updateRef(int columnIndex, Ref x) throws SQLException { notImplemented(); } public void updateRef(String columnName, Ref x) throws SQLException { notImplemented(); } public void updateBlob(int columnIndex, Blob x) throws SQLException { notImplemented(); } public void updateBlob(String columnName, Blob x) throws SQLException { notImplemented(); } public void updateClob(int columnIndex, Clob x) throws SQLException { notImplemented(); } public void updateClob(String columnName, Clob x) throws SQLException { notImplemented(); } public void updateArray(int columnIndex, Array x) throws SQLException { notImplemented(); } public void updateArray(String columnName, Array x) throws SQLException { notImplemented(); } } --- NEW FILE: MockStatement.java --- package com.mockobjects.sql; import java.sql.SQLException; import java.sql.ResultSet; public class MockStatement extends CommonMockStatement{ public boolean getMoreResults(int current) throws SQLException { notImplemented(); return false; } public ResultSet getGeneratedKeys() throws SQLException { notImplemented(); return null; } public int executeUpdate(String sql, int autoGeneratedKeys) throws SQLException { notImplemented(); return 0; } public int executeUpdate(String sql, int columnIndexes[]) throws SQLException { notImplemented(); return 0; } public int executeUpdate(String sql, String columnNames[]) throws SQLException { notImplemented(); return 0; } public boolean execute(String sql, int autoGeneratedKeys) throws SQLException { notImplemented(); return false; } public boolean execute(String sql, int columnIndexes[]) throws SQLException { notImplemented(); return false; } public boolean execute(String sql, String columnNames[]) throws SQLException { notImplemented(); return false; } public int getResultSetHoldability() throws SQLException { notImplemented(); return 0; } } |