This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes JDBC and the fly likes MetaData Incomplete? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "MetaData Incomplete?" Watch "MetaData Incomplete?" New topic
Author

MetaData Incomplete?

Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

I am needing to get some information about the columns in my database but I am not sure if the ResultSetMetaData is incomplete or if there is another way to obtain this information.
I am needing to get the length, default value, and description of each column in a table.


GenRocket - Experts at Building Test Data
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

Ok, figured out the length. Still needing the others.
Bas Holland
Greenhorn

Joined: Jun 20, 2003
Posts: 4
Hello Gregg Bolinger,

you did find out how to read the length of a resultSet.

I'm still searching , please : let me know!


Be nice .... as always :P
Shailesh Chandra
Ranch Hand

Joined: Aug 13, 2004
Posts: 1081


Originally posted by Gregg Bolinger:

I am needing to get the length, default value, and description of each column in a table.


DatabaseMetaData will do this job

here is the method I had written for one of the previous post




thanks
[ April 11, 2005: Message edited by: Shailesh Chandra ]

Gravitation cannot be held responsible for people falling in love ~ Albert Einstein
Shailesh Chandra
Ranch Hand

Joined: Aug 13, 2004
Posts: 1081

Just Wanted to mention that this method was written for one column
to get Details of all columns pass the "%" as the value of argument
String ColumnName, and change if(rs.next()) to while(rs.next())

Bas Holland : Just noticed that that original post is more than 1 year old its better to start a new thread

Shailesh
[ April 11, 2005: Message edited by: Shailesh Chandra ]
 
wood burning stoves
 
subject: MetaData Incomplete?
 
Similar Threads
Assertion enable or not?
Patterns Complete References
Passing Percentage???
Values after Submit Button pressed
Passed with 83% (5/9/2007)