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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Scrollable ResultSet

Status
Not open for further replies.

achen

Programmer
Jul 21, 2000
11
US
In my Servlet program, I have a method which get a Scrollable ResultSet. the code is as following:

try{ //try104
Statement stmt3 = conn2.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_READ_ONLY);

ResultSet rs3 = stmt3.executeQuery(sqlEvent);
rs3.last(); //move the cursor to the last row of the results
int num_row = rs3.getRow();
int p_death_ck = rs3.getInt("TYPE");


TYPE is one of the column in the Oracle table. It has varchar2 datatype in Oracle. The information in TYPE are all numbers (0 to 9). I used getInt() here and get an error message:

SQLException: Fail to convert to internal representation SQLState= null ErrorCode: 17059

Why can I do so?

 
Hi,
I think you should first get that field by using getString method of resultset and then use Integer.parseInt to convert it into integer.

regards
Y
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top