473,326 Members | 2,061 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

ID DB2 IDENTITY columns w/ type 4 JDBC DatabaseMetaData?

aj
Red Hat AS 2.1
DB2 WSE v8.1 FP5
Type 4 DB2 JDBC driver

Using java.sql.DatabaseMetaData and ResultSetMetaData,
I've written a JDBC/Java utility that shows, table by
table, columns & their types, NOT NULLness, PK, FK,
and unique indexes.

But one thing that I can't seem to extract is info
about what column(s) are DB2 IDENTITY columns.

Anyone have any ideas on how I can do this JDBC-wise?

TIA

aj
Nov 12 '05 #1
3 3733

"aj" <ro****@mcdonalds.com> ???? news:10*************@news.supernews.com...
Red Hat AS 2.1
DB2 WSE v8.1 FP5
Type 4 DB2 JDBC driver

Using java.sql.DatabaseMetaData and ResultSetMetaData,
I've written a JDBC/Java utility that shows, table by
table, columns & their types, NOT NULLness, PK, FK,
and unique indexes.

But one thing that I can't seem to extract is info
about what column(s) are DB2 IDENTITY columns.

Anyone have any ideas on how I can do this JDBC-wise?

TIA

aj


I think that you can check SYSCAT.COLIDENTATTRIBUTES catalog view, which
contains each identity column defined.
Nov 12 '05 #2
aj
I appreciate your reply - however I was looking for a JDBC API
way to do this, rather than something that is specific to DB2.
That way, my code is not chained to a specific database...

Any other ideas?

aj

XiaoLu Wang wrote:
"aj" <ro****@mcdonalds.com> ???? news:10*************@news.supernews.com...
Red Hat AS 2.1
DB2 WSE v8.1 FP5
Type 4 DB2 JDBC driver

Using java.sql.DatabaseMetaData and ResultSetMetaData,
I've written a JDBC/Java utility that shows, table by
table, columns & their types, NOT NULLness, PK, FK,
and unique indexes.

But one thing that I can't seem to extract is info
about what column(s) are DB2 IDENTITY columns.

Anyone have any ideas on how I can do this JDBC-wise?

TIA

aj

I think that you can check SYSCAT.COLIDENTATTRIBUTES catalog view, which
contains each identity column defined.

Nov 12 '05 #3
Can you access "extended describe" information? I know that CLI exposes
this information through extended/full describe. So the stuff is lying
around. Question is whether it's in the JDBC interface.

Cheers
Serge
Nov 12 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Swami | last post by:
Hi, I have installed MQ SQL Server 2000 on my laptop and trying to use SPRINTA 2000 JDBC Driver (inetmssql.jar) to connect to the local db. I wrote a sample Java app to test the connection and I...
5
by: Dov Moryusef | last post by:
Hi to all, I’ve a table with an idendity column : CREATE TABLE USRDB2.MYTABLE ( "ID" INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 0, INCREMENT BY 1, NO CACHE), "CODE"...
2
by: Maroon | last post by:
import java.sql.*; public class TESTA{ TESTA(){} public static int product() { try { Class.forName("com.ibm.db2.jcc.DB2Driver");
4
by: Ying Lu | last post by:
Hello, Under mysql, we have "desc tablename" to get the detail information about a table. My question is about to get column name, and column type for a specific table under PostgreSQL through...
15
by: Joe Weinstein | last post by:
Hi. Below is a simple JDBC program to insert and extract a numerical value. When ResultSet.getDouble() is called, the same program produces different output on solaris than it does on Linux. I...
3
by: drudini | last post by:
We have installed DB2UDB 8.2 on a windows 2003 server. How can I confirm the version of the JDBC driver that would have been installed with this? I wasn;t sure if the JBDC driver would have a...
1
by: Pete Geraghty | last post by:
I want to use DatabaseMetadata to retrieve details of those stored procedures which belong to the current schema. How can I find out what is the current schema for an existing Connection? Or...
2
by: dvawdrey | last post by:
Can someone help me please with the following code: try { DatabaseMetaData metadata=con.getMetaData(); System.out.println(metadata.getDriverName()); System.out.println("Driver version:...
9
bergy
by: bergy | last post by:
I am writing on an embedded device (J9 framework from IBM) that has a partial version of the java.sql package. It does not include Driver or DriverManager. I have downloaded the mysql Connector/J...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.