Rewrites `%s` internal placeholder in query, with parameters before preparing `java.sql.PreparedStatement`.