Skip to Main Content

Java Database Connectivity (JDBC)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Retrieving a tables description

843859May 9 2006 — edited May 10 2006
hi all
im designing an application which retrieves the tables stored in the database and displaying its contents and its description
As of now im using the ResultSetMetaData class to display the description about the table like the column names and its size

i have tried to do it by executing the query " desc tablename " ??

ex : Statement st = dataconnection.createStatement();
ResultSet rs = st.executeQuery("desc tablename");
while(rs.next())
{
String columnname[0] = rs.getString(1);

}

its showing invalid SQL statement error ,
so i got a doubt whether i can execute like that ??
if so ,how to do it ??

thnx in advance

keon
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 7 2006
Added on May 9 2006
3 comments
155 views