You can try something like this:
import java.sql.*;
public class EmpSal{
public static void main(String[] args){
try {
String maximumSalary;
Connection connection = DriverManager.getConnection("path to database", "username", "password");
Statement statement = connection.createStatement();
ResultSet resultset=statement.executeQuery("select * from EmpTable order by salary desc limit 1");
if(resultset.next()) {
maximumSalary = resultset.getString("firstName")+" "+resultset.getString("lastName");
}
System.out.println("The employee with higher salary is :");
System.out.println( maximumSalary);
}
catch (Exception exception){
System.out.println(exception);
}
}