Give the column an alias, say:
Select MAX(marks) mark from Marks_Table
...
rs.getInt("mark");
----- Original Message -----
From: Lalith Jayaweera <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, November 02, 1999 8:47 AM
Subject: Simple jdbc Problem
> 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
___________________________________________________________________________
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