Hi lalith,
  try to assign this value to long   getInt() .
This problem is because of fieldlength mismatch from table to servlet
try this.

kavitha


>From: Lalith Jayaweera <[EMAIL PROTECTED]>
>Reply-To: "A mailing list for discussion about Sun Microsystem's Java
>        Servlet API Technology." <[EMAIL PROTECTED]>
>To: [EMAIL PROTECTED]
>Subject: Simple jdbc Problem
>Date: Tue, 2 Nov 1999 05:47:09 +0500
>
>Hi,
>
>In one of my Servlet codes I have the following code Segment. How can I get
>the value of MAX(price) to  a variable using getInt("...");
>
>
>
>
>..
>..
>......
>try{
>  Statement stmt=con2.createStatement();
>  ResultSet rs=stmt.executeQuery("Select   MAX(marks) from Marks_Table");
>  if(rs.next())
>   {
>   maxMarks=rs.getInt(1);//gives run Time Errors
>
>..
>
>..
>thanks in advance
>
>___________________________________________________________________________
>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
>

______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com

___________________________________________________________________________
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

Reply via email to