Update of /cvsroot/mockobjects/mockobjects-java/src/jdk/1.3/com/mockobjects/sql In directory usw-pr-cvs1:/tmp/cvs-serv21660/src/jdk/1.3/com/mockobjects/sql Added Files: MockConnection.java MockMultiRowResultSet.java MockPreparedStatement.java MockResultSetMetaData.java MockSingleRowResultSet.java Log Message: Added abstraction layer to sql mocks to allow build against jdk1.4 --- NEW FILE: MockConnection.java --- package com.mockobjects.sql; public class MockConnection extends CommonMockConnection{ } --- NEW FILE: MockMultiRowResultSet.java --- package com.mockobjects.sql; public class MockMultiRowResultSet extends CommonMockMultiRowResultSet{ } --- NEW FILE: MockPreparedStatement.java --- package com.mockobjects.sql; public class MockPreparedStatement extends CommonMockPreparedStatement { } --- 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; public class MockSingleRowResultSet extends CommonMockSingleRowResultSet { } |