Hi
thank you very much for your help.
Yes you are right problem is not in the rs.next().
but after long research and debugging , what i found is
the column type in table is of NUMBER(5). But when i get the type in JAVA it
becomes SMALLINT.
As i read the smallint range is of -32768 to 32768
But the value that i am trying to retrieve is greater than (X > 32768).
Thats the reason i am getting the following error.
"ORA-01455: converting column overflows integer datatype."
I even tried to retrieve using getInt(col) method...still i am getting the
same error.
Does any one know how to fetch value from SMALLINT to INTEGER type.
I appreciate very much if anyone can respond to me.
Thank YOu
srikanth patibanda
-----Original Message-----
From: Simon Christian [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, October 05, 1999 10:34 AM
To: [EMAIL PROTECTED]
Subject: Re: while(rs.next())
At a guess from the error message, the problem is not in fact with
rs.next(),
but are you attempting to retrieve an int from the ResultSet on a following
line? e.g. int id = rs.getInt("id");
If the column you are attempting to retrieve data for is not of integer
type, it
could cause an error while converting at this stage. Check carefully.
- simon
"PATIBANDA, SRIKANTH" wrote:
> Hi,
>
> I am having some problem with rs.next().
> I am able to execute the query,
> statement = connection.createStatement();
> query = "Select * from XYZ";
> rs = statement.executeQuery(query);
>
> ResultSetMetaData rsmd = rs.getMetaData();
> numCols = rsmd.getColumnCount();
>
> for (i=1; i<=numCols; i++) {
> out.println("<td><H3>" + rsmd.getColumnLabel(i) + "</H3></td>");
> }
>
> My program is working till here very fine. I was able to display the
> columnlabel, the coulumn count and etc.
> The problem come now...in the while loop...
>
> while (rs.next()) {
>
> Its not that there is no data...there is data in the oracle database. When
i
> do directly from SQL> prompt works fine..with the same query its not
working
> with JDBC.
>
> At this point iam getting this following error...
>
> "ORA-01455: converting column overflows integer datatype."
>
> I debugged and i am sure the problem is with rs.next()...
> Does anyone know about this problem..what could be the solution...
> I really appreciate anyone help.
> ThankYou
> Srikanth Patibanda
> IT Specialist
> Entergy Corporation
> Ph: (W)504-576-5444
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html