I need help as I am struggling to assign null as a parameter to the select statement in my java program.
my script read values from the csv file and then selects the parameter based on the index provided. However, the values are sometime empty string e.g. (1,,3) so from index 1 it will pick the empty string and tries to set it as parameter in sql statement, this doesn't achieve the results I am looking for.
and as we know that sql handle null values in select statement with below syntax: e.g. select * from tablename where a IS NULL.
What is the best to set the value as null with below scenario:
select * from tableName where abc=?
stmt2.setString(1, csvVal.get(index));