This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
when i use any simple query like select quantity from purchaseorder where ponumber=somenumber then if record is not present then it returns false for if(rs.next()) which is correct but when i am using the query as select max(quantity) from purchaseorder where ponumber=somenumber then even though no records presents then also returns true for if(rs.next()) why it is so?
SQL functions always return something (even if that something is null). So select quantity from an empty table will give you an empty resultset, but select Max(quantity) from the same table will give you a result set with one row containing the result of the max() function (which might be 0, might be empty or might be "null" depending on your DB).