read database schema information from jdbc

Q

Quick Function

Here is my sql to create a table (B is another table)

create table A
(
ID NUMBER(10)
CONSTRAINT A_NN NOT NULL
CONSTRAINT A_id_FK REFERENCES B(ID),
Data NUMBER(10),
THRESHOLD NUMBER(10),
CONSTRAINT A_PK PRIMARY KEY (ID)
);

Can I retrieve all the constraint information (not null, foreign key,
pk...) from jdbc? Using a DatabaseMetaData?

Thanks,

qq
 
R

Roedy Green

Can I retrieve all the constraint information (not null, foreign key,
pk...) from jdbc? Using a DatabaseMetaData?

Look at the methods. I don't see much interesting other than whether
the field is allowed to be null.

Look also at ParameterMetaData and ResultSetMetaData
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top