java.sql.ResultSet#updateTime ( )源码实例Demo

下面列出了java.sql.ResultSet#updateTime ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: constellation   文件: ExportToJdbcPlugin.java
private static void updateResultSetParam(final GraphReadMethods rg, final ResultSet rs, final String label, final Attribute attr, final int id) throws SQLException {
    switch (attr.getAttributeType()) {
        case "boolean":
            rs.updateBoolean(label, rg.getBooleanValue(attr.getId(), id));
            break;
        case "date":
            final long date = rg.getLongValue(attr.getId(), id);
            if (date != Long.MIN_VALUE) {
                rs.updateDate(label, new Date(date));
            }
            break;
        case "datetime":
            final long timestamp = rg.getLongValue(attr.getId(), id);
            if (timestamp != Long.MIN_VALUE) {
                rs.updateTimestamp(label, new Timestamp(timestamp));
            }
            break;
        case "integer":
            rs.updateInt(label, rg.getIntValue(attr.getId(), id));
            break;
        case "float":
            rs.updateFloat(label, rg.getFloatValue(attr.getId(), id));
            break;
        case "time":
            final long time = rg.getLongValue(attr.getId(), id);
            if (time != Long.MIN_VALUE) {
                rs.updateTime(label, new Time(time));
            }
            break;
        default:
            final String s = rg.getStringValue(attr.getId(), id);
            if (s != null) {
                rs.updateString(label, s);
            }
            break;
    }
}
 
@Test(expected = SQLFeatureNotSupportedException.class)
public void assertUpdateTimeForColumnIndex() throws SQLException {
    for (ResultSet each : resultSets) {
        each.updateTime(1, new Time(0L));
    }
}
 
@Test(expected = SQLFeatureNotSupportedException.class)
public void assertUpdateTimeForColumnLabel() throws SQLException {
    for (ResultSet each : resultSets) {
        each.updateTime("label", new Time(0L));
    }
}
 
@Test(expected = SQLFeatureNotSupportedException.class)
public void assertUpdateTimeForColumnIndex() throws SQLException {
    for (ResultSet each : resultSets) {
        each.updateTime(1, new Time(0L));
    }
}
 
@Test(expected = SQLFeatureNotSupportedException.class)
public void assertUpdateTimeForColumnLabel() throws SQLException {
    for (ResultSet each : resultSets) {
        each.updateTime("label", new Time(0L));
    }
}