Java Code Examples for java.sql.ResultSet#updateTime()

The following examples show how to use java.sql.ResultSet#updateTime() . 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
Source File: ExportToJdbcPlugin.java    From constellation with Apache License 2.0 6 votes vote down vote up
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;
    }
}
 
Example 2
Source File: UnsupportedUpdateOperationResultSetTest.java    From sharding-jdbc-1.5.1 with Apache License 2.0 4 votes vote down vote up
@Test(expected = SQLFeatureNotSupportedException.class)
public void assertUpdateTimeForColumnIndex() throws SQLException {
    for (ResultSet each : resultSets) {
        each.updateTime(1, new Time(0L));
    }
}
 
Example 3
Source File: UnsupportedUpdateOperationResultSetTest.java    From sharding-jdbc-1.5.1 with Apache License 2.0 4 votes vote down vote up
@Test(expected = SQLFeatureNotSupportedException.class)
public void assertUpdateTimeForColumnLabel() throws SQLException {
    for (ResultSet each : resultSets) {
        each.updateTime("label", new Time(0L));
    }
}
 
Example 4
Source File: UnsupportedUpdateOperationResultSetTest.java    From shardingsphere with Apache License 2.0 4 votes vote down vote up
@Test(expected = SQLFeatureNotSupportedException.class)
public void assertUpdateTimeForColumnIndex() throws SQLException {
    for (ResultSet each : resultSets) {
        each.updateTime(1, new Time(0L));
    }
}
 
Example 5
Source File: UnsupportedUpdateOperationResultSetTest.java    From shardingsphere with Apache License 2.0 4 votes vote down vote up
@Test(expected = SQLFeatureNotSupportedException.class)
public void assertUpdateTimeForColumnLabel() throws SQLException {
    for (ResultSet each : resultSets) {
        each.updateTime("label", new Time(0L));
    }
}