File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and Relational Databases and the fly likes ResultSetMetaData problems Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "ResultSetMetaData problems " Watch "ResultSetMetaData problems " New topic

ResultSetMetaData problems

Xandu Morganheimer

Joined: Dec 02, 2004
Posts: 2
I am having a problem accessing all the functions available to ResultSetMetaData. Specifically, Websphere 5.1 is telling me that "method getColumnName(int) is undefined for the type ResultSetMetaData". Clearly it is defined even in the websphere documentation. Am I missing a plugin or something? I have posted the code below...

metadata = result.getMetaData();
resultMatrix.setColumnCount( metadata.getColumnCount() );
Vector DataRow;
Vector ArrayOfDataRows = new Vector( 1, 1 );

while ( )

DataRow = new Vector( 1, 1 );
String dataElement;

if( resultMatrix.getColumnCount() > 0) //Did we find any rows?
for (int i=1; i<= resultMatrix.getColumnCount(); i++)
// Get the column names
//------------------------------resultMatrix.getArrayOfColumnNames().addElement( new String( metadata.getColumnName(i) ) );
I get the error here when trying to compile getColumnName
Paul Sturrock

Joined: Apr 14, 2004
Posts: 10336

What is or isn't implemented is down to the JDBC Driver you are using. Check the docs for that.

JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Xandu Morganheimer

Joined: Dec 02, 2004
Posts: 2
Thanks, what you said made me think of the solution. The Websphere project I was using this out of contained all the version 5.0 jar's including the JDBC driver. I created a new 5.1.2 web project, moved my code, and now it works.
I agree. Here's the link:
subject: ResultSetMetaData problems
It's not a secret anymore!