Forums Register Login

ResultSetMetaData problems

+Pie Number of slices to send: Send
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
+Pie Number of slices to send: Send
What is or isn't implemented is down to the JDBC Driver you are using. Check the docs for that.
+Pie Number of slices to send: Send
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.
We don't have time to be charming! Quick, read this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 1037 times.
Similar Threads
JTABLE REFRESH PROBLEMS
Trouble consuming JSON format in JSP
getValueAt in JTable
Displaying data in a table
Populate data according to column from JDBC to JTable
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 09:24:47.