Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: JDBC data type support.

Re: JDBC data type support.

From: Joseph Weinstein <joe_at_weblogic.com>
Date: 2000/06/26
Message-ID: <3957ECA0.E02AADFD@weblogic.com>#1/1

Hi. It's a 'feature' :-) The issue is that the DBMS accepts the SQL *syntax* for defining int, smallint ccolumns etc, but translates them to it's NUMBER column. You *may* have retained some typing info. Check the precision and scale of the column. Oracle may have differentiated between int and smallint. Notice, however, that what Oracle creates for an INT column is a NUMBER column with zero subunit component, as you'd expect, but with enough digital places (decimal) to hold over 2 times a 64-bit long integer, so in that case it can cause confusion...

Joe Weinstein at BEA

fvda wrote:

> Hello everybody,
>
> After creating a table in which column i is specified as being a SMALLINT
> the
> methods
>
> ResultSetMetaData metaData = resultSet.getMetaData();
> metaData.getColumnType(i);
>
> didn't return the java.sql.Types.SMALLINT type. Apparently all kind of
> integers
> are mapped to NUMBERs. Is this a bug or a feature, and is there any
> workaround
> for this loss of typing information?
>
> Many thanks in advance
>
> Filip
>
> PS: Actually I would like to define a column as being a SQL BIT type. Oracle
> doesn't
> seem to support this data type directly so I thought of doing it
> indirectly
> through the Oracle SMALLINT data type, yet this doesn't seem to allow
> run-time
> colum type discovery at the same time, as internally all integers are
> represented
> by Oracle NUMBERs.

--

PS: Folks: BEA WebLogic is in S.F., and now has some entry-level positions for
people who want to work with Java and E-Commerce infrastructure products. Send
resumes to joe_at_beasys.com
--------------------------------------------------------------------------------
                    The Weblogic Application Server from BEA
         JavaWorld Editor's Choice Award: Best Web Application Server
  Java Developer's Journal Editor's Choice Award: Best Web Application Server
     Crossroads A-List Award: Rapid Application Development Tools for Java
Intelligent Enterprise RealWare: Best Application Using a Component Architecture
               http://weblogic.beasys.com/press/awards/index.htm
Received on Mon Jun 26 2000 - 00:00:00 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US