max(columnname) problem
hi,
i'm using oracle 8i and jdk 6
protectedint getItem()
{
int queue=0;
str="select nvl(max(queueno),0) as queue from jobprocess";
DBConnector dbcon=new DBConnector();
try
{
ResultSet rs=dbcon.getStatement().executeQuery(str);
if (rs.next())
queue=Integer.parseInt(rs.getObject(1).toString());
rs.close();
}
catch(SQLException sqlE)
{
sqlE.printStackTrace();
}
finally
{
dbcon.close();
return queue;
}
}
there are 164 rows in that jobprocess table.
As expected it should return 164, but returns 0. what is the wrong in above code
how to use sql aggregate functions using resultset.
please help me
thanks & regards,
s.mohamed asif

