jdbc: java.sql.Types <-> Oracle datatypes ?

jdbc: java.sql.Types <-> Oracle datatypes ?

Post by Charles Ma » Fri, 13 Oct 2000 04:00:00



I would like to find a reference table which shows all the Oracle
datatypes and their corresponding int-valued java.sql.Types.

My suspicion is that there are many more java.sql.Types that Oracle
types, and that in most cases there is a many-to-one relationship
between java.sql.Types and Oracle types.

In effect, I would like to be able to read from Oracle through JDBC a
java.sql.ResultSet and receive java.sql.Types other than 1,2,12,and 93
(CHAR, NUMERIC, VARCHAR, and TIMESTAMP). Is this impossible?

Sent via Deja.com http://www.deja.com/
Before you buy.

 
 
 

jdbc: java.sql.Types <-> Oracle datatypes ?

Post by Bob Beauchemi » Fri, 13 Oct 2000 04:00:00


Hi Charles,

This is explained in detail in Oracle 8i JDBC Developer's Guide and
Reference.

Ch 3 - Basic Features - Datatype mappings
Ch5 - Oracle Type Extentions

is probably what you want.

Hope this helps,

Bob Beauchemin


Quote:> I would like to find a reference table which shows all the Oracle
> datatypes and their corresponding int-valued java.sql.Types.

> My suspicion is that there are many more java.sql.Types that Oracle
> types, and that in most cases there is a many-to-one relationship
> between java.sql.Types and Oracle types.

> In effect, I would like to be able to read from Oracle through JDBC a
> java.sql.ResultSet and receive java.sql.Types other than 1,2,12,and 93
> (CHAR, NUMERIC, VARCHAR, and TIMESTAMP). Is this impossible?

> Sent via Deja.com http://www.deja.com/
> Before you buy.


 
 
 

1. Oracle<->Java datatype mapping + SQLExceptions

Hi all

I have a couple of queries:

1) Is there a way to tell the JDBC.thin driver to map particular sized
NUMBER data types to specific Java types? At the moment, everything from
NUMBER(30,15) to NUMBER(2) is mapped to a double?! I realise they can be
explicitly cast - but I really need to be able to do what is possible in
Sybase i.e. read Sybase INTs as java ints etc.

2) In Sybase I can do a getSQLState() and getSQLCode() - does anyone
know of a comprehensive list of these codes and states for Oracle, and
their associated meanings?

Thanks

Marcos

Sent via Deja.com http://www.deja.com/
Before you buy.

2. V4.5Win Novice Linking tables

3. VB5<->RDO2<->ODBC<->ORACLE Procedure Problem

4. SQL Server True vs Access True...

5. <><><>ORACLE DBA

6. Nesting Stored Procedures?

7. US-TX>>>Oracle DBA, HOUSTON<<<Yoh Information Technology

8. Archive logs