Thank You. It works fine.
I have one more question.
int ctype = rsmd.getColumnType(i);
If i use the above statement, i get the datatype but i get as Integer.
Is there any place that i can check what Integer maps what datatype.
And after knowing datatype, what particular method has to be used to
retrieve the data. I mean what getXXX methods has to be used.
Where can i find information regarding these....or if anyone has documented,
can i get a copy.
Thanks
srikanth patibanda
-----Original Message-----
From: Todd Costella [mailto:[EMAIL PROTECTED]]
Sent: Thursday, September 30, 1999 5:43 PM
To: [EMAIL PROTECTED]
Subject: Re: JDBC
You need to use the correct JDBC get<datatype> method that matches the
datatype of the columns that are returned in your query. If you are
returning an int, a varchar2 and a date you would have to use something
like rs.getInt(1),rs.getString(2),rs.getDate(3) etc. You can use the
JDBC meta data to determine what the datatypes of your columns are, but
unfortunatly, I don't have that information at my fingertips at the
moment. After you get the value for your query, you then convert it to a
string to send it to your output stream.
Todd
-----Original Message-----
From: PATIBANDA, SRIKANTH [mailto:[EMAIL PROTECTED]]
Sent: Thursday, September 30, 1999 3:29 PM
To: [EMAIL PROTECTED]
Subject: JDBC
Hi,
I am using Servlets, JDBC, Oracle Database. I can retrieve the data for
some
conditions but for some other conditions i am getting this weird error.
SQLState: 22003
Message: [Oracle][ODBC Oracle Driver][Oracle OCI]ORA-01455: converting
column overflows integer datatype.
Does anyone got this error before. Below i am giving my code.
rs = statement.executeQuery(query);
ResultSetMetaData rsmd = rs.getMetaData();
int numCols = rsmd.getColumnCount();
while (rs.next()) {
out.println("<tr>");
for (i=1; i<=numCols; i++) {
out.println("<td>" + rs.getString(i)+"</td>");
}
}
I appreciate anyone who can solve my problem.
Thanks
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
___________________________________________________________________________
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