i editted the code to bcome...
String sql = "SELECT LAST(StaffId) FROM Staff WHERE StaffId LIKE 'S*';";
try{
rsStaffId = stmtQuery.executeQuery(sql);
while(rsStaffId.next()){
//
//if(rsStaffId.isLast()){
String staffId = rsStaffId.getString(1);
//int seq = Integer.parseInt(rsStaffId.getString(1).substring(1, 3));
//jtfStaffID.setText("S"+ String.format("%03d",seq+1));
jtfStaffID.setText(""+staffId);
//}
}
}catch(Exception e){
JOptionPane.showMessageDialog(this, e.toString());
}
but i get null in my jtextfield..