下面列出了java.sql.ResultSet#updateByte ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。
private void assertUpdateState(
ResultSet rs,
String colName,
long value,
double dvalue,
int updateType,
String expected) throws SQLException {
try {
switch (updateType) {
case XXX_BYTE:
rs.updateByte(colName, (byte)value);
break;
case XXX_SHORT:
rs.updateShort(colName, (short)value);
case XXX_INT:
rs.updateInt(colName, (int)value);
break;
case XXX_LONG:
rs.updateLong(colName, value);
break;
case XXX_FLOAT:
rs.updateFloat(colName, (float)dvalue);
break;
case XXX_DOUBLE:
rs.updateDouble(colName, dvalue);
break;
default:
fail("wrong argument");
}
fail("exception expected");
} catch (SQLException e) {
println(e.toString());
assertSQLState(expected, e);
}
}
@Test(expected = SQLFeatureNotSupportedException.class)
public void assertUpdateByteForColumnIndex() throws SQLException {
for (ResultSet each : resultSets) {
each.updateByte(1, (byte) 1);
}
}
@Test(expected = SQLFeatureNotSupportedException.class)
public void assertUpdateByteForColumnLabel() throws SQLException {
for (ResultSet each : resultSets) {
each.updateByte("label", (byte) 1);
}
}
@Test(expected = SQLFeatureNotSupportedException.class)
public void assertUpdateByteForColumnIndex() throws SQLException {
for (ResultSet each : resultSets) {
each.updateByte(1, (byte) 1);
}
}
@Test(expected = SQLFeatureNotSupportedException.class)
public void assertUpdateByteForColumnLabel() throws SQLException {
for (ResultSet each : resultSets) {
each.updateByte("label", (byte) 1);
}
}
/**
Set this value into a ResultSet for a subsequent ResultSet.insertRow
or ResultSet.updateRow. This method will only be called for non-null values.
@exception SQLException thrown by the ResultSet object
@exception StandardException thrown by me accessing my value.
*/
public final void setInto(ResultSet rs, int position) throws SQLException, StandardException {
rs.updateByte(position, value);
}
/**
Set this value into a ResultSet for a subsequent ResultSet.insertRow
or ResultSet.updateRow. This method will only be called for non-null values.
@exception SQLException thrown by the ResultSet object
@exception StandardException thrown by me accessing my value.
*/
public final void setInto(ResultSet rs, int position) throws SQLException, StandardException {
rs.updateByte(position, value);
}
/**
Set this value into a ResultSet for a subsequent ResultSet.insertRow
or ResultSet.updateRow. This method will only be called for non-null values.
@exception SQLException thrown by the ResultSet object
@exception StandardException thrown by me accessing my value.
*/
public final void setInto(ResultSet rs, int position) throws SQLException, StandardException {
rs.updateByte(position, value);
}