Please refer to the code below.....when i press next,first,last and previous button there is error appearing..."ERROR IN SHOWING DATA".... why...?i copy directly from notes given by lecturer.....please detect the error....thanks
public void showRecord(String whereToMove){
try{
if(whereToMove.equals("First"))
rsStudent.first();
if(whereToMove.equals("Last"))
rsStudent.last();
if(whereToMove.equals("Previous"))
rsStudent.previous();
if(whereToMove.equals("Next"))
rsStudent.next();
jtfStudentID.setText(rsStudent.getString(1));
jtfStudentName.setText(rsStudent.getString(2));
jtfCourseID.setText(rsStudent.getString("CourseID" ));
jtfYear.setText(""+rsStudent.getInt(4));
jtfTutorialGroup.setText(rsStudent.getString(5));
}catch(SQLException ex){
JOptionPane.showMessageDialog(null,"Error in showing data...");
}
}
//begining i declare this and same goes to other buttons
jbtNext.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e){
showRecord("Next");
}
});

