Please help me out with this, there is problem with String qry.
import java.util.*; import java. public class AggregateFunction { public static void main(String[] args) { Connection con=null; Statement st=null; try { con=JdbcUtilMySql.getMySqlConnection(); st= con.createStatement(); Scanner sc = new Scanner(System.in); System.out.println("Enter Number: "); int n= sc.nextInt(); String qry ="select * from (select eid,ename,esal,eaddr,edpart,rank() over (order by esal DESC) as ranking from m.employee) where ranking: "+ n; ResultSet rs = st.executeQuery(qry); while (rs.next()) { System.out.println(rs.getInt(1)+"\t"+rs.getString(2)+"\t"+rs.getInt(3)+"\t"+rs.getString(4)+"\r"+rs.getString(5)); } sc.close(); }catch(Exception e) { e.printStackTrace(); } finally { JdbcUtilMySql.cleanup(st, con); } }