Java Code Examples for org.springframework.jdbc.InvalidResultSetAccessException

The following examples show how to use org.springframework.jdbc.InvalidResultSetAccessException. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
private void doTest(Method rsetMethod, Method rowsetMethod, Object arg, Object ret) throws Exception {
	if (arg instanceof String) {
		given(resultSet.findColumn((String) arg)).willReturn(1);
		given(rsetMethod.invoke(resultSet, 1)).willReturn(ret).willThrow(new SQLException("test"));
	}
	else {
		given(rsetMethod.invoke(resultSet, arg)).willReturn(ret).willThrow(new SQLException("test"));
	}
	rowsetMethod.invoke(rowSet, arg);
	try {
		rowsetMethod.invoke(rowSet, arg);
		fail("InvalidResultSetAccessException should have been thrown");
	}
	catch (InvocationTargetException ex) {
		assertEquals(InvalidResultSetAccessException.class, ex.getTargetException().getClass());
	}
}
 
Example 2
Source Project: java-technology-stack   Source File: ResultSetWrappingSqlRowSet.java    License: MIT License 6 votes vote down vote up
/**
 * @see java.sql.ResultSet#findColumn(String)
 */
@Override
public int findColumn(String columnLabel) throws InvalidResultSetAccessException {
	Integer columnIndex = this.columnLabelMap.get(columnLabel);
	if (columnIndex != null) {
		return columnIndex;
	}
	else {
		try {
			return this.resultSet.findColumn(columnLabel);
		}
		catch (SQLException se) {
			throw new InvalidResultSetAccessException(se);
		}
	}
}
 
Example 3
Source Project: java-technology-stack   Source File: ResultSetWrappingSqlRowSet.java    License: MIT License 5 votes vote down vote up
/**
 * @see java.sql.ResultSet#first()
 */
@Override
public boolean first() throws InvalidResultSetAccessException {
	try {
		return this.resultSet.first();
	}
	catch (SQLException se) {
		throw new InvalidResultSetAccessException(se);
	}
}
 
Example 4
@Override
public String getSchemaName(int column) throws InvalidResultSetAccessException {
	try {
		return this.resultSetMetaData.getSchemaName(column);
	}
	catch (SQLException se) {
		throw new InvalidResultSetAccessException(se);
	}
}
 
Example 5
Source Project: java-technology-stack   Source File: ResultSetWrappingSqlRowSet.java    License: MIT License 5 votes vote down vote up
/**
 * @see java.sql.ResultSet#getObject(int, Map)
 */
@Override
public Object getObject(int columnIndex, Map<String, Class<?>> map) throws InvalidResultSetAccessException {
	try {
		return this.resultSet.getObject(columnIndex, map);
	}
	catch (SQLException se) {
		throw new InvalidResultSetAccessException(se);
	}
}
 
Example 6
@Override
public String getColumnName(int column) throws InvalidResultSetAccessException {
	try {
		return this.resultSetMetaData.getColumnName(column);
	}
	catch (SQLException se) {
		throw new InvalidResultSetAccessException(se);
	}
}
 
Example 7
Source Project: spring-analysis-note   Source File: ResultSetWrappingSqlRowSet.java    License: MIT License 5 votes vote down vote up
/**
 * @see java.sql.ResultSet#getDouble(int)
 */
@Override
public double getDouble(int columnIndex) throws InvalidResultSetAccessException {
	try {
		return this.resultSet.getDouble(columnIndex);
	}
	catch (SQLException se) {
		throw new InvalidResultSetAccessException(se);
	}
}
 
Example 8
@Override
public int getColumnType(int column) throws InvalidResultSetAccessException {
	try {
		return this.resultSetMetaData.getColumnType(column);
	}
	catch (SQLException se) {
		throw new InvalidResultSetAccessException(se);
	}
}
 
Example 9
Source Project: spring-analysis-note   Source File: ResultSetWrappingSqlRowSet.java    License: MIT License 5 votes vote down vote up
/**
 * @see java.sql.ResultSet#getNString(int)
 */
@Override
public String getNString(int columnIndex) throws InvalidResultSetAccessException {
	try {
		return this.resultSet.getNString(columnIndex);
	}
	catch (SQLException se) {
		throw new InvalidResultSetAccessException(se);
	}
}
 
Example 10
Source Project: java-technology-stack   Source File: ResultSetWrappingSqlRowSet.java    License: MIT License 5 votes vote down vote up
/**
 * @see java.sql.ResultSet#getTime(int, Calendar)
 */
@Override
public Time getTime(int columnIndex, Calendar cal) throws InvalidResultSetAccessException {
	try {
		return this.resultSet.getTime(columnIndex, cal);
	}
	catch (SQLException se) {
		throw new InvalidResultSetAccessException(se);
	}
}
 
Example 11
Source Project: spring-analysis-note   Source File: ResultSetWrappingSqlRowSet.java    License: MIT License 5 votes vote down vote up
/**
 * @see java.sql.ResultSet#getObject(int, Map)
 */
@Override
public Object getObject(int columnIndex, Map<String, Class<?>> map) throws InvalidResultSetAccessException {
	try {
		return this.resultSet.getObject(columnIndex, map);
	}
	catch (SQLException se) {
		throw new InvalidResultSetAccessException(se);
	}
}
 
Example 12
Source Project: java-technology-stack   Source File: ResultSetWrappingSqlRowSet.java    License: MIT License 5 votes vote down vote up
/**
 * @see java.sql.ResultSet#getTimestamp(int)
 */
@Override
public Timestamp getTimestamp(int columnIndex) throws InvalidResultSetAccessException {
	try {
		return this.resultSet.getTimestamp(columnIndex);
	}
	catch (SQLException se) {
		throw new InvalidResultSetAccessException(se);
	}
}
 
Example 13
Source Project: java-technology-stack   Source File: ResultSetWrappingSqlRowSet.java    License: MIT License 5 votes vote down vote up
/**
 * @see java.sql.ResultSet#beforeFirst()
 */
@Override
public void beforeFirst() throws InvalidResultSetAccessException {
	try {
		this.resultSet.beforeFirst();
	}
	catch (SQLException se) {
		throw new InvalidResultSetAccessException(se);
	}
}
 
Example 14
Source Project: java-technology-stack   Source File: ResultSetWrappingSqlRowSet.java    License: MIT License 5 votes vote down vote up
/**
 * @see java.sql.ResultSet#relative(int)
 */
@Override
public boolean relative(int rows) throws InvalidResultSetAccessException {
	try {
		return this.resultSet.relative(rows);
	}
	catch (SQLException se) {
		throw new InvalidResultSetAccessException(se);
	}
}
 
Example 15
Source Project: java-technology-stack   Source File: ResultSetWrappingSqlRowSet.java    License: MIT License 5 votes vote down vote up
/**
 * @see java.sql.ResultSet#getBoolean(int)
 */
@Override
public boolean getBoolean(int columnIndex) throws InvalidResultSetAccessException {
	try {
		return this.resultSet.getBoolean(columnIndex);
	}
	catch (SQLException se) {
		throw new InvalidResultSetAccessException(se);
	}
}
 
Example 16
@Override
public boolean isCurrency(int column) throws InvalidResultSetAccessException {
	try {
		return this.resultSetMetaData.isCurrency(column);
	}
	catch (SQLException se) {
		throw new InvalidResultSetAccessException(se);
	}
}
 
Example 17
Source Project: spring-analysis-note   Source File: ResultSetWrappingSqlRowSet.java    License: MIT License 5 votes vote down vote up
/**
 * @see java.sql.ResultSet#getTimestamp(int, Calendar)
 */
@Override
public Timestamp getTimestamp(int columnIndex, Calendar cal) throws InvalidResultSetAccessException {
	try {
		return this.resultSet.getTimestamp(columnIndex, cal);
	}
	catch (SQLException se) {
		throw new InvalidResultSetAccessException(se);
	}
}
 
Example 18
@Override
public String getCatalogName(int column) throws InvalidResultSetAccessException {
	try {
		return this.resultSetMetaData.getCatalogName(column);
	}
	catch (SQLException se) {
		throw new InvalidResultSetAccessException(se);
	}
}
 
Example 19
@Override
public boolean isSigned(int column) throws InvalidResultSetAccessException {
	try {
		return this.resultSetMetaData.isSigned(column);
	}
	catch (SQLException se) {
		throw new InvalidResultSetAccessException(se);
	}
}
 
Example 20
Source Project: spring-analysis-note   Source File: ResultSetWrappingSqlRowSet.java    License: MIT License 5 votes vote down vote up
/**
 * @see java.sql.ResultSet#beforeFirst()
 */
@Override
public void beforeFirst() throws InvalidResultSetAccessException {
	try {
		this.resultSet.beforeFirst();
	}
	catch (SQLException se) {
		throw new InvalidResultSetAccessException(se);
	}
}
 
Example 21
Source Project: java-technology-stack   Source File: ResultSetWrappingSqlRowSet.java    License: MIT License 5 votes vote down vote up
/**
 * @see java.sql.ResultSet#isLast()
 */
@Override
public boolean isLast() throws InvalidResultSetAccessException {
	try {
		return this.resultSet.isLast();
	}
	catch (SQLException se) {
		throw new InvalidResultSetAccessException(se);
	}
}
 
Example 22
Source Project: spring-analysis-note   Source File: ResultSetWrappingSqlRowSet.java    License: MIT License 5 votes vote down vote up
/**
 * @see java.sql.ResultSet#isFirst()
 */
@Override
public boolean isFirst() throws InvalidResultSetAccessException {
	try {
		return this.resultSet.isFirst();
	}
	catch (SQLException se) {
		throw new InvalidResultSetAccessException(se);
	}
}
 
Example 23
Source Project: spring-analysis-note   Source File: ResultSetWrappingSqlRowSet.java    License: MIT License 5 votes vote down vote up
/**
 * @see java.sql.ResultSet#relative(int)
 */
@Override
public boolean relative(int rows) throws InvalidResultSetAccessException {
	try {
		return this.resultSet.relative(rows);
	}
	catch (SQLException se) {
		throw new InvalidResultSetAccessException(se);
	}
}
 
Example 24
@Override
public String getColumnClassName(int column) throws InvalidResultSetAccessException {
	try {
		return this.resultSetMetaData.getColumnClassName(column);
	}
	catch (SQLException se) {
		throw new InvalidResultSetAccessException(se);
	}
}
 
Example 25
Source Project: java-technology-stack   Source File: ResultSetWrappingSqlRowSet.java    License: MIT License 5 votes vote down vote up
/**
 * @see java.sql.ResultSet#getDate(int)
 */
@Override
public Date getDate(int columnIndex) throws InvalidResultSetAccessException {
	try {
		return this.resultSet.getDate(columnIndex);
	}
	catch (SQLException se) {
		throw new InvalidResultSetAccessException(se);
	}
}
 
Example 26
@Override
public String getSchemaName(int column) throws InvalidResultSetAccessException {
	try {
		return this.resultSetMetaData.getSchemaName(column);
	}
	catch (SQLException se) {
		throw new InvalidResultSetAccessException(se);
	}
}
 
Example 27
@Override
public int getScale(int column) throws InvalidResultSetAccessException {
	try {
		return this.resultSetMetaData.getScale(column);
	}
	catch (SQLException se) {
		throw new InvalidResultSetAccessException(se);
	}
}
 
Example 28
Source Project: java-technology-stack   Source File: ResultSetWrappingSqlRowSet.java    License: MIT License 5 votes vote down vote up
/**
 * @see java.sql.ResultSet#getString(int)
 */
@Override
public String getString(int columnIndex) throws InvalidResultSetAccessException {
	try {
		return this.resultSet.getString(columnIndex);
	}
	catch (SQLException se) {
		throw new InvalidResultSetAccessException(se);
	}
}
 
Example 29
@Override
public String getCatalogName(int column) throws InvalidResultSetAccessException {
	try {
		return this.resultSetMetaData.getCatalogName(column);
	}
	catch (SQLException se) {
		throw new InvalidResultSetAccessException(se);
	}
}
 
Example 30
@Override
public String getColumnTypeName(int column) throws InvalidResultSetAccessException {
	try {
		return this.resultSetMetaData.getColumnTypeName(column);
	}
	catch (SQLException se) {
		throw new InvalidResultSetAccessException(se);
	}
}