We have an SQL statement that is executed by Jdbi ( org.skife.jdbi.v2). For the binding parameters, we use the Jdbi method bind:
Handle handle = ...
Query<Map<String, Object>> sqlQuery = handle.createQuery(query);
sqlQuery.bind(...)
However, we have a problem with lists, and we are currently using for this String.format. Therefore, our request may look like this:
SELECT DISTINCT
tableOne.columnOne,
tableTwo.columnTwo,
tableTwo.columnThree
FROM tableOne
JOIN tableTwo
ON tableOne.columnOne = tableTwo.columnOne
WHERE tableTwo.columnTwo = :parameterOne
AND tableTwo.columnThree IN (%s)
%sis replaced by String.format, so we need to create the correct line in java code. Then, after the replacement %s, we use the jdbi method bindto replace all other parameters ( :parameterOneor ?).
String.format jdbi? bind(String, Object), /. , , factory , , - .