Hi Franco,

    The short version is that with the Toolbox/JTOpen driver,
DatabaseMetaData.getPrimaryKeys() does not return key info for default DDS
created files.  It does work for a table created with SQL like:

CREATE TABLE JSTEMP/FTESTPK
(COL1 INT NOT NULL WITH DEFAULT,
 COL2 INT NOT NULL WITH DEFAULT,
 COL3 VARCHAR (30) NOT NULL WITH DEFAULT,
 PRIMARY KEY (COL1, COL2))

    You can use getIndexInfo() and check for the table name with the
Toolbox/JTOpen driver.  Note that, just for fun, the Toolbox/JTOpen and
native drivers do different things.  For more information, see:

"Getting JDBC Metadata from legacy tables" at

http://dbforums.com/t661310.html

and

"Native JDBC Driver Does Not Return Primary Keys with getIndexInfo Method"
at

<
http://www-912.ibm.com/s_dir/slkbase.NSF/0/52fc5bbe726b0d3a86256f6b0058b955?OpenDocument
>


                                                         Joe Sam

Joe Sam Shirah -        http://www.conceptgo.com
conceptGO       -        Consulting/Development/Outsourcing
Java Filter Forum:       http://www.ibm.com/developerworks/java/
Just the JDBC FAQs: http://www.jguru.com/faq/JDBC
Going International?    http://www.jguru.com/faq/I18N
Que Java400?            http://www.jguru.com/faq/Java400


----- Original Message ----- 
From: "Franco Biaggi" <fbiaggi@xxxxxxxxxx>
To: <JAVA400-L@xxxxxxxxxxxx>
Sent: Sunday, May 01, 2005 12:02 PM
Subject: JDBC DatabaseMetaData getPrimaryKeys


> Hello,
>
> is there any people that managed DatabaseMetaData getPrimaryKeys(...) to
> work ?
>
> I always receive an empty ResutSet.
>
> Thanks for help.
>
> -- 
> --------------------------------------------------------------------------
---
> *** This messages was scanned for malicious contents ***
> --------------------------------------------------------------------------
---
> Franco Biaggi
> CH-6807 Taverne
>


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.