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 |
|
Get Java Programming with Oracle JDBC now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.