So I am trying to execute a query that takes 2 int values from the user however I am getting this error message. What I am doing wrong?
"at least one parameter to the current statement is uninitialized"
This is my Query
selectStudentsInRange = connection.prepareStatement("SELECT* FROM Results WHERE total BETWEEN ? AND ?");
An this is my method, yes is not the whole code.
public List< Results > getTotalMarksInRange( int value1, int value2 )
{
List< Results > results = null;
ResultSet resultSet = null;
try
{
selectStudentsInRange.setInt( value1, value2 ); // specify id
// executeQuery returns ResultSet containing matching entries
resultSet = selectStudentsInRange.executeQuery();
results = new ArrayList< Results >();
Please notice that this is not the whole code I have many classes I am just wondering what is my error in this part.