how to get the oracle datatype of a given column in java
DBAsupport.com Forums - Powered by vBulletin
Results 1 to 2 of 2

Thread: how to get the oracle datatype of a given column in java

Hybrid View

  1. #1
    Join Date
    Dec 2001
    Posts
    120
    hi,

    Thanks for all ur earlier responses.

    We tried to use Java's (JDK 1.3) ResultsetMetadata class to get info on oracle datatype for a given column in a given table. We found that the integer , float , number datatypes are all mapped on to Java.Sql.Type.numeric. Is there any way to get the exact oracle datatype for the respective columns. For eg. if oracle datatype is float then the ResultsetMetadata also returns "float" instead of returning "numeric".


    thanks

    Paul

  2. #2
    Join Date
    Sep 2001
    Location
    NJ, USA
    Posts
    1,287
    1. Oracle has "numeric" datatype only on internal (database ) level, because Oracle has NUMBER datatype in db.

    2. if u want to get information from db dictionary directly (not from ResultsetMetadata) u may use:

    select DATA_TYPE,DATA_LENGTH ... from all_tab_columns
    where
    owner = 'SCHEMA' and
    table_name = 'UR_TABLE' and
    column_name = 'COL_NAME';

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width