use of com.torodb.backend.udt.record.MongoTimestampRecord in project torodb by torodb.
the class MongoTimestampRecordSqlBinding method get.
@Override
public MongoTimestampRecord get(ResultSet resultSet, int columnIndex) throws SQLException {
PGobject pgObject = (PGobject) resultSet.getObject(columnIndex);
if (pgObject == null) {
return null;
}
String value = pgObject.getValue();
int indexOfComma = value.indexOf(',');
Integer secs = Integer.parseInt(value.substring(1, indexOfComma));
Integer count = Integer.parseInt(value.substring(indexOfComma + 1, value.length() - 1));
return new MongoTimestampRecord(secs, count);
}
Aggregations