A distinct type is a user-defined data type that is internally
represented as a built-in SQL data type. You create a distinct type
by executing the SQL statement CREATE DISTINCT TYPE.
In a JDBC program, you can create a distinct type using the executeUpdate method
to execute the CREATE DISTINCT TYPE statement. You can also use executeUpdate to
create a table that includes a column of that type. When you retrieve
data from a column of that type, or update a column of that type,
you use Java identifiers with
data types that correspond to the built-in types on which the distinct
types are based.
The following example creates a distinct type that is based on
an INTEGER type, creates a table with a column of that type, inserts
a row into the table, and retrieves the row from the table: