If it is an SQLException which is thrown by Java, then it is most possibly because you're attempting to set or get the value from the ResultSet, although, the index you are utilising is not within the range.
For example, you might be attempting to get the column at index 3 from the result set, although you are simply having two columns being returned from the SQL query.
Join the SQL Training course now if you want to gain more knowledge in SQL.