Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
Difference between revisions of "EclipseLink/Development/DBWS/OracleUseCases"
Line 8: | Line 8: | ||
::<code>java.sql.Struct</code>'s are realized in Oracle using proprietary types (<code>oracle.sql.STRUCT</code>) and APIs that are encapsulated in EclipseLink's <code>DatabasePlatform</code> (specifically <code>org.eclipse.persistence.platform.database.oracle.Oracle8Platform</code> or higher) | ::<code>java.sql.Struct</code>'s are realized in Oracle using proprietary types (<code>oracle.sql.STRUCT</code>) and APIs that are encapsulated in EclipseLink's <code>DatabasePlatform</code> (specifically <code>org.eclipse.persistence.platform.database.oracle.Oracle8Platform</code> or higher) | ||
**Array Types | **Array Types | ||
− | ::<code>java.sql.Array</code>'s are realized in Oracle using proprietary types (<code>oracle.sql.VARRAY</code>) and APIs that are encapsulated in EclipseLink's <code>DatabasePlatform</code> (specifically <code>org.eclipse.persistence.platform.database.oracle.Oracle8Platform</code> or higher) | + | ::<code>java.sql.Array</code>'s are realized in Oracle using proprietary types (<code>oracle.sql.VARRAY</code>) and APIs that are encapsulated in EclipseLink's <code>DatabasePlatform</code> (specifically <code>org.eclipse.persistence.platform.database.oracle.Oracle8Platform</code> or higher) |
+ | An extreme (!) use-case: an object type wrapped in an array type, wrapped in another object type which is again wrapped in an array type and (finally!) wrapped in a third object type. | ||
+ | * Scalar PL/SQL datatypes | ||
+ | Some PL/SQL datatypes have no JDBC equivalent and must be converted. The strategy is to use an anonymous PL/SQL block and handle the type conversion before the invocation of the Stored Procedure: | ||
+ | ** BOOLEAN | ||
+ | <source lang=sql> | ||
+ | declare | ||
+ | x_target boolean := SYS.SQLJUTL.INT2BOOL(:1); | ||
+ | begin | ||
+ | bool_test(x=>x_target); | ||
+ | end; | ||
+ | </source> | ||
+ | ** PLS_INTEGER | ||
+ | ** SMALLINT | ||
+ | ** NUMERIC | ||
+ | ** BINARY_INTEGER | ||
+ | ** PLS_INTEGER | ||
+ | ** NATURAL | ||
+ | ** NATURALN | ||
+ | ** POSITIVE | ||
+ | ** POSITIVEN | ||
+ | ** SIGNTYPE | ||
+ | ** DEC | ||
+ | ** DECIMAL | ||
+ | ** LONG | ||
+ | ** LONG_RAW | ||
+ | ** RAW | ||
+ | |||
+ | |||
+ | |||
* Advanced PL/SQL types as arguments to Stored Procedure calls | * Advanced PL/SQL types as arguments to Stored Procedure calls | ||
**Record types | **Record types |
Revision as of 16:31, 17 December 2009
Supported Use-Cases for Oracle Platforms
All of the use-cases support for non-Oracle Platforms are supported on Oracle
The design-time utility DBWSBuilder
uses custom Data Dictionary queries for the Oracle Platform (the java.sql.DatabaseMetaData
API suffers from well-documented problems of accuracy and scope1).
By doing so, additional use-cases can be supported:
- Advanced JDBC types as arguments to Stored Procedure calls
- Object Types
java.sql.Struct
's are realized in Oracle using proprietary types (oracle.sql.STRUCT
) and APIs that are encapsulated in EclipseLink'sDatabasePlatform
(specificallyorg.eclipse.persistence.platform.database.oracle.Oracle8Platform
or higher)
- Array Types
java.sql.Array
's are realized in Oracle using proprietary types (oracle.sql.VARRAY
) and APIs that are encapsulated in EclipseLink'sDatabasePlatform
(specificallyorg.eclipse.persistence.platform.database.oracle.Oracle8Platform
or higher)
An extreme (!) use-case: an object type wrapped in an array type, wrapped in another object type which is again wrapped in an array type and (finally!) wrapped in a third object type.
- Scalar PL/SQL datatypes
Some PL/SQL datatypes have no JDBC equivalent and must be converted. The strategy is to use an anonymous PL/SQL block and handle the type conversion before the invocation of the Stored Procedure:
- BOOLEAN
DECLARE x_target BOOLEAN := SYS.SQLJUTL.INT2BOOL(:1); BEGIN bool_test(x=>x_target); END;
- PLS_INTEGER
- SMALLINT
- NUMERIC
- BINARY_INTEGER
- PLS_INTEGER
- NATURAL
- NATURALN
- POSITIVE
- POSITIVEN
- SIGNTYPE
- DEC
- DECIMAL
- LONG
- LONG_RAW
- RAW
- Advanced PL/SQL types as arguments to Stored Procedure calls
- Record types
- this is something
- Collection types
- And again, something more
1
Compliance to the meta-data APIs available through the java.sql.DatabaseMetaData
is weak - no vendor implements the APIs fully, nor in a standard fashion. For example, the simple act of getting the names of available databases is different across platforms: on Oracle the getSchemas
method is used while for DB2/Sybase/MS SQLServer the getCatalogs
method is used. Another example of cross-platform meta-data issues is the getColumns
method: for PostgreSQL, the name of the table must be lower-case; for Oracle, it must be upper-case; others support mixed-case. link is a case-study of some of the issues.