DatabaseMetaData.getSQLKeywords()

Hi,
This method
Gets a comma-separated list of all a database's SQL keywords that are NOT also SQL92 keywords. This list even didn't return CREATE this kind of popular words.
how can I get ALL Oracle key words through JDBC?
Thanks,
Dongsheng
null

Encode binary data as hexadecimal.
http://www.javaworld.com/javatips/jw-javatip117.html

Similar Messages

  • Oracle JDBC Driver 10.2.0.1.0 DataBaseMetaData Incorrect For Unary FKs

    Friends,
    My firm (which is not a MetaLink subscriber) has discovered a bug in the Oracle 10g JDBC Driver (10.2.0.1.0). The bug affects unary associations, namely cases in which the foreign key of a table points to that very table's primary key.
    In such cases, method DatabaseMetaData.getExportedKeys (which is designed to return all foreign keys that reference a specified table) fails to return the foreign key reference. The method works correctly as long as the foreign key "points to" a different table. Example:
    ResultSet lResultSetForeignKeys = aDatabaseMetaData.getExportedKeys(<foo>)
    while (lResultSetForeignKeys.next())
    // NOTHING RETURNED
    In this case, the ResultSet contains no elements.
    We discovered this problem testing the same logic against a cross-section of commercial databases. All other DBMS drivers produce the correct result except for the Oracle drivers.
    If some brave soul would convert this into a MetaLink TAR we'd sure appreaciate it, and if possible we'd love to be in the loop regarding the progress on this issue. My e-mail ID is [email protected], and I'm working on behalf of Corticon Technologies, Inc.
    Sincerely,
    David Lynch
    General Manager, SOTA

    My understanding is that to be a MetaLink subscriber you have to be an Oracle customer or subscribe for Oracle support services. Since Oracle is only one of the many databases we support, and because our sole objective with Oracle is compatibility testing, it's unlikely that we will become subscribers unless it's essentially free.
    Oracle is tangential (not core) to our own offerings, so we don't have a pressing need for support. Is there some avenue for people in our shoes?

  • DatabaseMetadata.getProcedure - MS SQL REMARK location?

    Hey all,
    Using the DatabaseMetaData.getProcedures() method to retrieve sprocs. I would like very much to use the procedure REMARK column, but I do not understand where to place this information in MS SQL 2005 for each sproc. Does anyone know please?
    I saw some documentation in DB2 for a comment field, which I assume would return in the procedure REMARK field. If someone could verify DB2 location, as well as any other databases (Oracle, MySQL, Postgres, etc). MS SQL 2005 is my primary focus however.
    edit: prefer to use JTDS (1.2.2 or higher), but if can also/only be accomplished with SQLJDBC.jar, please identify.
    Edited by: binarymonk_01 on Jul 9, 2008 6:16 AM

    Also If I change to NAT from the public IP to the NLB IP to use either one of the phsyical IPs of the NLB cluster (192.168.0.50 or 51) it works fine when using the public IP.  So it's definatly an issue when NATing the VIP of NLB cluster.
    Chris

  • DatabaseMetaData.getProcedureColumns not returning correct type

    Here's the situation.
    I have an object type.
    CREATE TYPE ttest AS OBJECT (
    elem1 VARCHAR2(1),
    elem2 NUMBER(20),
    I have an Table Type of the Object Type.
    CREATE TYPE tabtest AS TABLE of ttest;
    I'm using the Table Type as input to a package function.
    function test (arrTabTest IN tabtest) return number;
    When using the DatabaseMetaData, the getProcedureColumns tells me that the parameter is of type "TABLE".
    How do I determine what the real Table Type is (ie. "tabtest")?
    Thanks
    Gary R. Kline
    Chief Technology Architect
    BVN Solutions, Inc.

    Hi Justin, thank you for responding.
    for both the ODBC and oo4o example I am using the SQL statement below:
    varSQL = "SELECT * FROM food"
    The food table has two filed, a main of type varchar2 and a quantity of type number.
    Both the main and the quantity are coming back to my ASP application as string type.
    Thank You for the help.
    Samir

  • Getting AUTO_INCREMENT info from DatabaseMetaData

    Hi all,
    I am experimenting with DatabaseMetaData on a MySQL database. Does anyone know how to get the information that a column of a table is autoincremented.
    The DatabaseMetaData.getColumns(...) method does not seem to return this info.
    Suppose a table created by
    CREATE TABLE book
    (book_id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY,
    title VARCHAR(255))
    The DatabaseMetaData returns all information of this table except that book_id is AUTO_INCREMENT.
    Or am I missing something?
    cu
    Achim

    You can use what the DatabaseMetaData.getColumns(...) return. Because the method DatabaseMetaData.getColumns(...) return a ResultSet object.
    From the ResultSet you can know if the colunm is autoincrement or not.
    Use the ResultSet.getMetaData() method that return a ResultSetMetaData object, then use the ResultSetMetaData.isAutoIncrement(int column) method that Indicates whether the column is automatically numbered.Good luck

  • DatabaseMetaData.getAttributes throwing 'unsupported feature' exception

    Hi, maybe someone can help me with this.
    For a given schema, I'm trying to find the definition of a user-defined type. However, the getAttributes method of DatabaseMetaData throws an exception, claiming that the feature is unsupported.
    This is the code:
    Connection connection = null; ResultSet resultSet = null; try { connection = DriverManager.getConnection( URL, USERNAME, PASSWORD ); DatabaseMetaData dbMD = connection.getMetaData(); System.out.printf( "%s %d.%d%n", dbMD.getDatabaseProductName(), dbMD.getDatabaseMajorVersion(), dbMD.getDatabaseMinorVersion() ); resultSet = dbMD.getAttributes( null, null, "BATCH_T", "%" ); // this is line 32 // code to print the ResultSet } finally { if( resultSet != null ) resultSet.close(); if( connection != null ) connection.close(); }
    And this is the output:
    Oracle 10.2 Exception in thread "main" java.sql.SQLException: Unsupported feature         at oracle.jdbc.OracleDatabaseMetaData.getAttributes(OracleDatabaseMetaData.java:10980)         at udttest.Main.main(Main.java:32)
    The driver is the very latest one from the Oracle site, ojdbc6.jar, version 11.2.0.2.0. According to the JavaDocs of OracleDatabaseMetaData, the getAttributes method has been there since 9.0.2. So does this means that the method has merely been present, and always throws this exception?
    Alternatively, is there another way of programmatically retrieve information about a user-defined type?
    Thanks,
    - Peter

    Severity One wrote:
    jschell wrote:
    Severity One wrote:
    Yes, but the question was not how PL/SQL could know about how a Java object looks like, but how Java can know how a PL/SQL object looks like.You said the following.
    +"One issue we have at work is to pass to or receive from a PL/SQL stored procedure a Java object."+
    What I read from that is that you wish to get/send a "java object" to PL/SQL.
    Thus PL/SQL would in fact need to know what a "java object" is.No, you forgot to read the context: I wanted to know how Java could figure out how an Oracle user-defined type looked like, not the other way around. This business of "PL/SQL knowing about a Java object" is something you invented, that you keep harking on, and which I never said. So could you please drop it?
    I read what you posted, not your mind.
    Well, I could think of having the business logic for an application in PL/SQL, and using Java to create an API or web > > > Specifically, it's about an SMS sending application, which is interacting with just one table in Oracle and an SMS-C. Want to send an SMS? Insert it into the table. Want to receive one? Read it from the table. Any application that wants to send any number of SMS's, would therefore interact with this database, and a lot of things can be done purely in Oracle, without the need of having a separate application requiring the attention of support staff.Which I can implement completely and easily without using PL/SQL user defined types.Really? There are a lot of optional parameters when sending an SMS. It's not just sender, recipient and text content. So if I want to send, say an identical message to 10,000 recipients, or I want to send 10,000 individual messages; in both cases, with certain parameters for such things like time-outs, SMS-C port, protocol ID, data coding, delivery report options, priority, and all the other things that SMPP allows you to define, how would you pass those in a manner that doesn't lead to dozens of stored procedures, or very long parameter lists?
    Standard normal form in relational databases - an option table.
    And I doubt a valid format for delivery would work with 10,000 recipients stored in a single UDF verus a receiptant table.
    Not to mention of course that the fact that there might be one case for a UDF doesn't mean that the usage is a good idea for most applications. Or even that one application that uses a single UDF will need more than one of them.
    Restating what I said "...doesn't mean that it *normally* a good idea to use it."
    To clarify your confusion about that statement it means that there will in fact be some cases where it is acceptable but most cases it is not.
    Or do you prefer calling stored procedures with endless parameter lists? Or to have a whole bunch of insert and update statements called from Java?No idea what you are talking about. See the above example about sending SMS messages.
    Option table.
    First what you mention above is a standard idiom in all programming languages and used extensively since interactions between programming languages and relational database began.What, whole loads of stored procedures, or doing all the updates and inserts from Java? We've come to the conclusion that the inability to validate an SQL statement in Java source code is a bugger, and that it's better to do this sort of thing in a stored procedure. Also, using arrays means a significant performance improvement, and an array of objects/user-defined types is the next thing that comes to mind.
    That will not be a consideration in most applications. And for those applications where there is a proven performance bottleneck at the database layer most applications would be better served with one or more of the following
    1. Redoing the architecture/design
    2. Using a caching mechanism.
    3. Even look at redoing the requirements.
    Secondly I have no idea what you mean by "endles parameter lists". I do not have that problem. If you do then I can only suggest that you should look at problems with your design rather than than attempting to solve it with your implementation.If you have a lot of parameters, like with sending SMS messages, some of which are optional whilst others are not, and when many of these parameters are identical between different insert statements, you have two options:
    * use very long parameter lists.
    * use user-defined types; for example, an array with 'recipient + messages' types, and a single 'all other options' type.
    Or an option table.
    Perhaps not, but I didn't take off at a tangent. Anyway, one way of preventing binding is by having one of the frameworks figure out on its own what the other is doing. The whole reflection and annotation thing in Java lets you do that. Unfortunately, the getAttributes() method does not.
    First as you yourself noted it is irrelevant.No, that's something you claimed. When you ask for an example, don't brush them off as being irrelevant.
    My mistake then.
    Second dynamic interface code is NOT a mechanism that reduces coupling. The fact that it is dynamic does not alter the dependency.It reduced coupling between source code, which is what it's all about. I can always fix a library; it's a lot easier than changing dozens of applications.
    No it doesn't. Coupling is coupling. The manner of calling the methods doesn't alter the semantics that require that the method is called in the first place.
    That is similar to claiming that something like perl/javascript is less "coupled" because the language is interpreted versus C++ where the method calls are compiled. Which of course is not true.
    I can store data in a database, any database, in any number of ways. None of which would require a Oracle user defined type.True, but I'm using Oracle for more than just storing data. PL/SQL is extremely powerful for certain operations, and it'd be silly not to employ that power.Which has nothing to do with what I said.Quite frankly, I'm at a loss what point exactly you're trying to make. Passing data between Java and Oracle user-defined types and arrays is a total pain, so as a programmer I'm trying to find a way to do this in a standard way, something that can be put in a library. I agree that it a complex issue.
    It however is not something that most applications need however since most do not need UDFs.
    And so I have written such a library: small, database-agnostic (should work with any JDBC data source, although I haven't tested it yet), but with annotations to mark what UDT a class maps to, and to what field within the UDT each field of the class maps to. It's the annotation bit I was wondering whether it could be avoided. Obviously, because Oracle doesn't support the getAttributes method, it would no longer be database-agnostic. Which is not really a problem, because we only use Oracle, unless a vendor supports only some other database.
    Not sure what that means since most other databases do not support UDFs.
    That fact that a feature exists is not by itself a reason to use it. Java has 'strictfp' but I have never had a single business need that required that I use it. As such if I saw someone attempting to use it or stating that it must be used then I would insist that the provide specific details driven from the business needs that required its usage.The fact that you cannot think of a use or a business need, does not mean one does not exist. I suggest you re-read my first post, since that is not what I said.

  • HOw to get  DatabaseMetaData using JPA

    hi;
    I am using ejb3 , jpa for database connectivity .is there any way to get the metadata about the database in JPA.
    ie:- in JDBC we can use DatabaseMetaData for getting this. HOw can we get the Database Meta Data by using JPA.
    Regards
    Irshad

    In addition to Gurvinder references, go over the productCatalog.xml or customCatalog.xml file to know the properties in each item-descriptor of ProductCatalog.
    In your requirement skuid is same as repositoryId.
    If you are using in jsp then use SKULookUp droplet to get the sku repositoryItem.
    If you need it in java code then use catalogTools.findSKU(String skuid).
    Peace
    Shaik

  • Create table statement from DatabaseMetaData

    Hi Experts,
    Do you know if it's possible to retrieve a create table statement based on a DatabaseMetaData ? (without looping through columnName / Type)
    The idea is to get the DatabaseMetaData from one db server, and execute the Create Table statements on a different db server.
    One obvious solution would be to loop through each table's column name/type and construct the create table statement manually, but I'd like to know whether this can be automated.
    Thanks in advnace,
    Sid

    Bigger databases provide a way to access most schema information from the database itself. That doesn't mean that the jdbc meta information is sufficient nor the best way to do that.
    There are existing tools that allow for migrations as well. Especially if the migration is a one to one mapping.

  • DatabaseMetaData.getTypeInfo ()=NULL when use JDBC Driver 9.2.0.5

    Why DatabaseMetaData.getTypeInfo () is NULL when use JDBC Driver 9.2.0.5 to connect Oracle 9.0.1.1.1 database?
    In the following links
    http://www.oracle.com/technology/tech/java/sqlj_jdbc/htdocs/jdbc_faq.htm#02_02
    the segment "Which JDBC drivers support which versions of Oracle Database?" tells us that JDBC Driver 9.2.0.5 can support Oracle 9.0.1.1.1 database.
    thanks!

    ERROR --- java.sql.SQLException: ORA-01722: &#26080;&#25928;&#25968;&#23383;

  • Problem with DatabaseMetaData.getCrossReference()

    Hi, All,
    I got a problem with DatabaseMetaData.getCrossReference(...). Let me simplify it to the following senario:
    I have two tables in RDBMS: table A with colums A1, A2, A3, A4 and table B with columns B1, B2. Table B has a composite primary key (B1, B2). And I have two references:
    1. (A1, A4) references (B1, B2)
    2. (A3, A2) references (B1, B2)
    In this cases, it seems to me that there is no way in JDBC to detect these relations. All the api's of getCrossReference(), getImportedKeys() and getExportedKeys() are not working!!!
    I appreciate your help!
    Thanks
    Tao
    2003/06/19

    Could somebody help me out?
    Thanks in advance!
    Tao

  • Querying character column sizes using DatabaseMetadata

    Hi,
    In a UTF-8 database, I've created two testing tables, one that uses byte length semantics (BLS) for its CHAR and VARCHAR2 columns, and one using character length semantics (CLS). If I use the standard JDBC DatabaseMetdata.getColumns() query, the size of the CLS columns is reported as 4 times that of the BLS columns. I don't believe this is the desired behaviour for the JDBC drivers.
    Regardless, does anyone know a way to accurately determine (preferably using standard JDBC methods) the size of a CHAR or VARCHAR column in characters across different database configurations? I need this to compare column lengths in a ASCII and UTF8 database.
    I'm using the standalone JDBC drivers v9.2.0.3 for JDK1.4 (odjbc.jar) running aginst Oracle 9.2.0.0.
    The following code, which contains some DDL to create sample tables, can be used to dump the column metadata returned by Oracle's database drivers.
    import java.sql.*;
    import java.util.*;
    The following script can be used to create two test tables, the first with
    byte-size columns, and the second with character-size columns.
    CREATE TABLE TMP
    TMP_ID NUMBER(12) NOT NULL PRIMARY KEY,
    TMP_CHAR CHAR(200 BYTE),
    TMP_VCHAR VARCHAR2(100 BYTE)
    CREATE TABLE TMP2
    TMP_ID NUMBER(12) NOT NULL PRIMARY KEY,
    TMP_CHAR CHAR(200 CHAR),
    TMP_VCHAR VARCHAR2(100 CHAR)
    public class DatabaseMetadata
    private static final String COLUMN_NAMES[] = {
    "TABLE_CAT",
    "TABLE_SCHEM",
    "TABLE_NAME",
    "COLUMN_NAME",
    "DATA_TYPE",
    "TYPE_NAME",
    "COLUMN_SIZE",
    "BUFFER_LENGTH",
    "DECIMAL_DIGITS",
    "NUM_PREC_RADIX",
    "NULLABLE",
    "REMARKS",
    "COLUMN_DEF",
    "SQL_DATA_TYPE",
    "SQL_DATETIME_SUB",
    "CHAR_OCTET_LENGTH",
    "ORDINAL_POSITION",
    "IS_NULLABLE"
    private static final int COLUMN_WIDTHS[] = {
    10, // "TABLE_CAT",
    11, // "TABLE_SCHEM",
    10, // "TABLE_NAME",
    11, // "COLUMN_NAME",
    10, // "DATA_TYPE",
    10, // "TYPE_NAME",
    11, // "COLUMN_SIZE",
    13, // "BUFFER_LENGTH",
    13, // "DECIMAL_DIGITS",
    13, // "NUM_PREC_RADIX",
    10, // "NULLABLE",
    10, // "REMARKS",
    10, // "COLUMN_DEF",
    10, // "SQL_DATA_TYPE",
    10, // "SQL_DATETIME_SUB",
    10, // "CHAR_OCTET_LENGTH",
    10, // "ORDINAL_POSITION",
    10, // "IS_NULLABLE"
    private static final char WHITESPACE[] =
    .toCharArray();
    private static final String HYPHENS =
    private static String formatRow(String row[])
    StringBuffer buffer = new StringBuffer(128);
    for (int j=0;j<row.length;j++)
    if (j > 0)
    buffer.append(" | ");
    String text = row[j];
    int width = COLUMN_WIDTHS[j];
    if (text == null)
    buffer.append(WHITESPACE, 0, width);
    else if (text.length() > width)
    buffer.append(text.substring(0, width));
    else
    buffer.append(text).append(WHITESPACE, 0, width - text.length());
    } // j
    return buffer.toString();
    } // private static String formatRow(String[])
    private static void printColumnMetadata(
    DatabaseMetaData metadata, String tableName)
    throws SQLException
    System.out.println("\n" + tableName + "\n");
    System.out.println(formatRow(COLUMN_NAMES));
    String hyphens[] = new String[18];
    Arrays.fill(hyphens, HYPHENS);
    System.out.println(formatRow(hyphens));
    ResultSet results = metadata.getColumns(null, null, tableName, "%");
    String columnMetadata[] = new String[18];
    while (results.next())
    for (int i=0;i<18;i++)
    Object result = results.getObject(i+1);
    columnMetadata[i] = result == null ? "NULL" : result.toString();
    } // i
    System.out.println(formatRow(columnMetadata));
    results.close();
    } // private static void printColumnMetadata(DatabaseMetaData, String)
    public static void main(String argv[])
    throws Exception
    Driver driver = (Driver)Class.forName(
    "oracle.jdbc.driver.OracleDriver").newInstance();
    DriverManager.registerDriver(driver);
    Connection connection = DriverManager.getConnection(
    argv[0], argv[1], argv[2]);
    // ((oracle.jdbc.OracleConnection)connection).setRemarksReporting(true);
    try
    DatabaseMetaData metadata = connection.getMetaData();
    printColumnMetadata(metadata, "TMP");
    printColumnMetadata(metadata, "TMP2");
    catch (SQLException e)
    e.printStackTrace();
    connection.close();
    } // public class DatabaseMetadata

    It appears that this forum uses "[" "i" "]" to denote italics internally, so these characters are missing where the code sample becomes italic, between 'columnMetadata' and '='.

  • DatabaseMetaData getColumns :- type_name returns 'int identity' (SQLServer)

    Hi all,
    I am using the JDBC DatabaseMetaData API, getColumns() method. The back end is SQLServer 2005.
    Now according to how the API is specified, I am using index 6(I think)(type_name) to retrieve the data type name from the resultset for each column.
    However, for one column I am getting the datatype as "int identity".
    This column has been set as identity with increment 1 in SQLServer 2005. But when I say type_name, why am I getting this "identity" word?? Should'nt I just be getting "int"??
    I have found this problem to be unique to SQLServer... unless of course if someone has found this same behaviour on some other DB vendor.
    Does anyone have any reason as to why, for SQLServer, this type_name index returns the "<datatype> + 'identity' "?
    Actually, in my project, I just need the actualy data type only!! I do not need the identity keyword at all! (So I had to create a work around where it would ignore thhis word and just take the data type.... :-( )
    Thanx.

    [Check this|http://media.datadirect.com/download/docs/connectsqlxml/jdbcug/jdbcsqls.htm] and search for "data types".
    (This info should also be found in the docs for the Driver.)
    Every DB defines its own types, of course. Usually at least partially compliant with SQL 92/98. It is up to the driver to map those types to the JDBC types.
    You can also see this.
    There is, under Connection, a getTypeMap method. Unfortunately, if the app doesn't add any types to the map, this method returns an empty map. I haven't palyed with this, but it is definately possible that using it will only return user-defined types (mapped by the application). Then again, it may return the full Map as soon as one is added, then again, the Driver, may add the type conversions to the map itself, on initialisation, and so, it may return the complete map from from the beginning. I don't know. As I said, I haven't played with it.

  • GetColumns(String x,String y,String z,String w) method in  DatabaseMetaData

    hi!
    i want information about tables n their columns for perticular database.
    i m using getcolums(String catlog,String schemapattern,String tablenamepattern,String columnnamepattern) method in DatabaseMetaData.I m using sql server 2000 as my db n i want all columns from all the tables.
    what should be the last 2 string parameters in the above method.
    i have tried the following.
    DatabaseMetaData dbmd = dbcon.getMetaData();//dbcon is connection object
    ResultSet rs = dbmd.getColumns("students","dbo","*","*");
    while(rs.next())
    this code does not enter the while loop what cud b the problem??

    what should be the last 2 string parameters in the
    above method.
    dbmd.getColumns("students","dbo","*","*");The wildcard character in SQL is % not *
    (Why are some many people using the * as the wildcard?)
    dbmd.getColumns("students","dbo","%","%");
    Should return all columns for all tables.
    Thomas

  • DatabaseMetaData.getColumns(...) returns an invalid size of NVARCHAR2

    Hi,
    I have the following problem.
    I'm using ojdbc14.jar version 10.2.0.2.0
    I'm trying to read table metadata from database using DatabaseMetaData.getColumns(...). And, when I read the size of a NVARCHAR2 column (using either COLUMN_SIZE or CHAR_OCTET_LENGTH) it returns the double of the maximum length (as if it were expressed in bytes!)
    Javadocs says: COLUMN_SIZE int => column size. For char or date types this is the maximum number of characters, for numeric or decimal types this is precision.
    Does anyone have the same problem?
    Does anyone know if there is an open bug on this topic?
    I will really appreciate your help
    Thanks
    ArielUBA

    Hi Ashok,
    Thanks for your answer.
    I tried changing NLS_LENGTH_SEMANTICS parameter, and unfortunately it was unsuccessful :-(
    I'm using NVARCHAR2 column type and in http://download.oracle.com/docs/cd/B19306_01/server.102/b14237/initparams127.htm says the following:
    NCHAR, NVARCHAR2, CLOB, and NCLOB columns are always character-based
    I also tried to use (in a simple test case) the newest available driver 11.1.0.6.0. (but, for production I need ojdbc14.jar) and I got the same result.
    PreparedStatement smt = connection.prepareStatement("ALTER SESSION SET NLS_LENGTH_SEMANTICS=CHAR");
    smt.execute();
    connection.commit();
    DatabaseMetaData metaData = connection.getMetaData();
    ResultSet columns = metaData.getColumns(null, "ENG_AAM_572_STD_1E", "PPROCINSTANCE", "V_LOAN_NUMBER");
    dispVerticalResultSet(columns);The column length of V_LOAN_NUMBER is 31 characters and the result was:
    TABLE_CAT=null
    TABLE_SCHEM=ENG_AAM_572_STD_1E
    TABLE_NAME=PPROCINSTANCE
    COLUMN_NAME=V_LOAN_NUMBER
    DATA_TYPE=1111
    TYPE_NAME=NVARCHAR2
    COLUMN_SIZE=62
    BUFFER_LENGTH=0
    DECIMAL_DIGITS=null
    NUM_PREC_RADIX=10
    NULLABLE=1
    REMARKS=null
    COLUMN_DEF=NULL
    SQL_DATA_TYPE=0
    SQL_DATETIME_SUB=0
    CHAR_OCTET_LENGTH=62
    ORDINAL_POSITION=32
    IS_NULLABLE=YES
    Are you sure that I'm dealing with the bug 4485954?
    Do you know if there is a workaround?
    Thanks in advance for your time
    ArielUBA

  • DatabaseMetaData for Oracle Object Types

    I have successfully written a Java program to read a schema - i.e. Tables, Primary Keys, Imported Keys, Exported Keys & Columns - using DatabaseMetaData. However, I need to decompose Oracle Objects.
    My test case is:
    SQL> desc object_column_table
    Name Null? Type
    ID NUMBER(11)
    TYP OBJ_COL_TYP
    SQL> desc obj_col_typ
    Name Null? Type
    VC VARCHAR2(255)
    NUM NUMBER(11)
    DT DATE
    CH CHAR(7)
    I believe I have found the method that I require:
    public void showAttributes(String schema, String typeName, String attribute)
    The JavaDoc says "Retrieves a description of the given attribute of the given type for a user-defined type (UDT) that is available in the given schema and catalog."
    However, this throws "java.sql.SQLException: Unsupported feature"
    My driver details are:
    Driver Name: Oracle JDBC driver
    Version: 10.1.0.2.0
    Major Version: 10
    Minor Version: 1
    JDBC Major Version: 10
    JDBC Minor Version: 1
    Connected to:
    Oracle Database 10g Enterprise Edition Release 10.1.0.4.0 - Production
    With the Partitioning, OLAP and Data Mining options
    So, how do I decompose Oracle Objects?
    Thanks in advance for your help.

    reynaudj,
    Try searching this forum's archives for the term "STRUCT". Perhaps also search the OTN Web site as well.
    Good Luck,
    Avi.

Maybe you are looking for