APISonar


java.sql.JDBCType.TIME

> java > sql > JDBCType > TIME
java APIs sql APIs JDBCType APIs TIME APIs

Example 1
public void writeWithDateFieldWithTimeTypeFromMetaData() throws Exception {
    Date fieldValue = new Date();
    Object expectedValueWritten = new java.sql.Time(fieldValue.getTime());
    JDBCType dataType = JDBCType.TIME;
    when(tableMetaDataView.getColumnDataType(fieldName)).thenReturn(dataType);
    when(value.getField(fieldName)).thenReturn(fieldValue);

    when(statement.executeUpdate()).thenReturn(1);
    Object createKey = "createKey";
    handler.write(region, Operation.CREATE, createKey, value);

    verify(statement).setObject(1, expectedValueWritten);
    verify(statement).setObject(2, createKey);
    verify(statement).close();
  }
Example 2
boolean passDataAsString(int colNum) {
        JDBCType jt = getColumn(colNum).getJdbctype();
        return (JDBCType.CHAR == jt || JDBCType.VARCHAR == jt || JDBCType.NCHAR == jt || JDBCType.NVARCHAR == jt
                || JDBCType.TIMESTAMP == jt || JDBCType.DATE == jt || JDBCType.TIME == jt || JDBCType.LONGVARCHAR == jt
                || JDBCType.LONGNVARCHAR == jt);
    }