MyEclipse Forums
This thread has been locked & this forum has been archived.
Please post new topics to Java EE Development (EJB, JSP, Struts, XDoclet, etc.)
View previous topic Printable version Log in to check your private messages View next topic
Author Message
froses
Post subject: DB Explorer unable to show Oracle tables and columns remarks  PostPosted: Sep 09, 2011 - 03:20 PM
Registered Member
Registered Member


Joined: Apr 28, 2006
Posts: 52

Hello,

I'm using an Oracle database in one of my projects and I observed DB Explorer is unable to show Oracle tables and columns remarks.

I think may be interestig DB Explorer can show this metadata info.

I know there is a trick to obtain Oracle tables and columns names. If you use java.sql.Connection.getMetaData() method the names are missing. By default, Oracle JDBC driver do not provides the names. You must do a casting to oracle.jdbc.driver.OracleConnection class and use the method setRemarksReporting(boolean) to force the driver to provide this information:

Code:
java.sql.Connection con = ....
jdbc.driver.OracleConnection oCon = (jdbc.driver.OracleConnection) con;
oCon.setRemarksReporting(true);
DatabaseMetaData md = oCon.getMetaData();
ResultSet rs = md.getTables("null", "aSchema", "aTableName", new String[] {"TABLE"});
while (rs.next()) {
  String remarks = rs.getString("REMARKS");
}


May be the DB Explorer problem not showing Oracle remarks is not the bizarre method needed to obtain Oracle metadata. But if this is the problem, I hope this few lines of code can help you.

Best regards and thanks for your excellent work!

Francesc Rosés
 
 View user's profile Send private message Visit poster's website  
Reply with quote Back to top
support-tony
Post subject:   PostPosted: Sep 12, 2011 - 11:47 AM



Joined: Mar 09, 2011
Posts: 939

Francesc,

Thanks for pointing out this omission. I've raised a problem report for the lack of column comments and an enhancement request to show table comments.

Thanks, also, for the hints on how this may be implemented.

_________________
Tony
MyEclipse Support
 
 View user's profile Send private message  
Reply with quote Back to top
froses
Post subject:   PostPosted: Sep 17, 2011 - 09:50 AM
Registered Member
Registered Member


Joined: Apr 28, 2006
Posts: 52

You're welcome!

Francesc Rosés
 
 View user's profile Send private message Visit poster's website  
Reply with quote Back to top
Display posts from previous:     
Jump to:  
All times are GMT - 6 Hours
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.
View previous topic Printable version Log in to check your private messages View next topic
Powered by PNphpBB2 © 2003-2004 The PNphpBB Group
Credits