background image
<< REAL data type | User-defined types >>

TIME data type

<< REAL data type | User-defined types >>
Derby Reference Manual
202
SMALLINT
Corresponding compile-time Java type
java.lang.Short
JDBC metadata type (java.sql.Types)
SMALLINT
Minimum value
-32768 (java.lang.Short.MIN_VALUE)
Maximum value
32767 (java.lang.Short.MAX_VALUE)
When mixed with other data types in expressions, the resulting data type follows the rules
shown in
Numeric type promotion in expressions
.
See also
Storing values of one numeric data type in columns of another numeric data
type
.
Constants in the appropriate format always map to INTEGER or BIGINT, depending on
their length.
TIME data type
TIME provides for storage of a time-of-day value.
Syntax
TIME
Corresponding compile-time Java type
java.sql.Time
JDBC metadata type (java.sql.Types)
TIME
Dates, times, and timestamps cannot be mixed with one another in expressions except
with a CAST.
Any value that is recognized by the java.sql.Time method is permitted in a column of the
corresponding SQL date/time data type. Derby supports the following formats for TIME:
hh:mm[:ss]
hh.mm[.ss]
hh[:mm] {AM | PM}
The first of the three formats above is the java.sql.Time format.
Hours may have one or two digits. Minutes and seconds, if present, must have two digits.
Derby also accepts strings in the locale specific datetime format, using the locale of the
database server. If there is an ambiguity, the built-in formats above take precedence.
Examples
VALUES TIME('15:09:02')
VALUES '15:09:02'
TIMESTAMP data type