I am assessing a piece of code to check the possibility of sql injection. I noticed that before making a prepared statement, a string is constrcuted just for the where condition (named strwhere) and then this is passed to a function that created the prepared statement. Noting that in the strwhere it is built using string concatenation, does this raise an sql injection? or just the fact that is passed to a prepared statement eliminates this risk?
Code:
String strWhere = whereString + " AND " + "(" + Table1.ID + "=" + ID + ")";
Rows = myTable.readRow(jdbcSource, stWhere);
in the readRow function, it builds the final query using prepared statement.