• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

problem with DatabaseMetaData

 
Gerenne Vives
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello ,

I have a problem when I use DatabaseMetaData , I want the primary keys , and when I use getPrimaryKeys , return the user of database , when I try to obtain the schema and catalog this return null .

Can comebody help me ??

Thanks in advance.
 
Shailesh Chandra
Ranch Hand
Posts: 1082
Java Oracle Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please put some code here

thanks
 
Gerenne Vives
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ok , the code is following:

ResultSet rsDBMetaData=dbMetaData.getPrimaryKeys(connection.getCatalog(), resulsetMetaData.getSchema(column), table);

this the sentence.
 
Shailesh Chandra
Ranch Hand
Posts: 1082
Java Oracle Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Irene Rodriguez:
ok , the code is following:

ResultSet rsDBMetaData=dbMetaData.getPrimaryKeys(connection.getCatalog(), resulsetMetaData.getSchema(column), table);

this the sentence.


Irene,

the two lines of code given by you are ok, but not enough to find the problem.

please visit this thread.

also tell us that which database are you using and try your program with hard coded values first.

Shailesh
 
Gerenne Vives
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks , my problem is that instead of to return the prmary key to the table , return me the user to the table , I try to do of the link , but my problem continue....



thanks
 
Shailesh Chandra
Ranch Hand
Posts: 1082
Java Oracle Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can you provide complete code !!

I am more interested that how are you getting values from rsDBMetaData.
and what is your database

Shailesh
[ March 30, 2005: Message edited by: Shailesh Chandra ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic