when i am running the preparedstatement with setString(index,value), it's throwing index out of range. even though the index is correct, 1 with 1 parameter.

turns out the cause is, java is treating single quote of ? as part of the statement instead of the placeholder.