I have found out what the error is.
When we use a ResultSet object to get the date please note:
if we use: ResultSetobject.getString("Name of column") we should place these statements in order of the column designed in our database. For example:
You have 5 columns namely: Field1, Field2, Field3, Field4, Field5.
If you get them by NAME you should get them in order: The following code will give error:
rs.getString("Field2");
rs.getString("Field1");
It should be like this:
rs.getString("Field1");
rs.getString("Field2");