I am trying to update a value if record exists else insert the values to database. However, that is not working. I have written below code. any help please.
Code:

String sqlCheck = "Select * from [UAP_EMPLOYEE] where EMP_EMPLOYEE_ID = '"+empId+"' ";
PreparedStatement prpStatementCheck = conn.prepareStatement(sqlCheck);
prpStatementCheck.setString(1, EMP_EMPLOYEE_ID);
ResultSet rsCheck=prpStatementCheck.executeQuery();
String check=null;

 while((rsCheck.next())
{
     if(rsCheck.next()>0)
      update statement; 
     else
         Insert Statement; 
}