• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

ResultSetMetaData problems

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ( result.next() )
{
resultMatrix.incrementRowCount();

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
 
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What is or isn't implemented is down to the JDBC Driver you are using. Check the docs for that.
 
Xandu Morganheimer
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic