Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Cannot find method getColumnLabel(int)

Status
Not open for further replies.

EverActive

Programmer
Sep 27, 2005
2
US
I am getting is error in JBuilder I am using java version 1.5.0_03-b07 and JBuilder 2005 Foundation.
here is the code:

<code>
public String[] headings(ResultSet query){
int numbcols=0;
String error[] = new String[5];
try{
ResultSetMetaData bob = query.getMetaData();
numbcols = bob.getColumnCount();
String[] returns = new String[numbcols];
for (int i=1; i<=numbcols ; i++){
returns[i-1]= bob.getColumnLabel(i);// <--error
}
return returns;
}catch(Exception ex){ System.err.println("Error in headings: " + ex); return error;}

}
</code>
"data.java": cannot find symbol; symbol : method getColumnLabel(int), location: interface java.sql.ResultSetMetaData at line 105, column 30


The imports are:
import java.awt.*;
import javax.swing.*;
import com.borland.jbcl.layout.XYLayout;
import com.borland.jbcl.layout.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.sql.*;
import java.awt.event.WindowEvent;
import java.awt.event.WindowAdapter;
import java.io.*;
import java.lang.*;


Any help would be extremely appreciated.
Thx
 
Oh yeah I forgot to add when I paste this same code into other IDE's they compile fine.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top