Data Types
Whether you move data between two computers, computer systems, or programs written in different programming languages, you’ll need to identify which data types can be moved from one setup to another and how. This problem arises when you retrieve data from an Oracle database in a Java program and store data from a Java program in the database. It’s a function of the JDBC driver to know how to move or convert the data as it moves between your Java program and Oracle, but you as the programmer must know what is possible or, more importantly, legal. Table 10-1 lists the Oracle SQL data types and all their valid Java data type mappings.
Table 10-1. Valid Oracle SQL-to-Java data type mappings
|
Oracle SQL data type |
Valid Java data type mappings |
|---|---|
|
BFILE |
|
|
BLOB |
|
|
CHAR, VARCHAR2, LONG |
|
|
CLOB |
|
|
DATE |
|
|
OBJECT |
|
|
NUMBER |
|
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access