従業員の最大給与を見つけるためのこのコードは、netbeans で Java を使用して phpmyadmin のデータベースに格納されたデータです。
case 5:{//start of max salary 5
RS = st.executeQuery("select * from firsttable where having max(salary)");
System.out.println("the employee with max salary: ");
while (RS.next())
{ //start while loop
//retrieve data
String []data = {RS.getString("ID"),
RS.getString("firstName"),
RS.getString("lastName"),
RS.getString("birthDate"),
RS.getString("salary"),
RS.getString("lastLogin")};
{//start print data
System.out.println("ID: "+data[0]);
//System.out.println("ID int: "+RS.getInt("ID"));
System.out.println("firstName: "+data[1]);
System.out.println("lastName: "+data[2]);
System.out.println("birthDate: "+data[3]);
System.out.println("salary: "+data[4]);
System.out.println("lastLogin: "+data[5]);
}//end print data
}//end while loop
break;
}//end of max salary 5