private static String prepareSql(String sql, List<String> names) {
        logger.info("Prepare sql: " + sql);
        String parts[] = sql.split(":");
        StringBuilder bld = new StringBuilder();
        boolean first = true;
        for (String part: parts) {
            if (first) {
                first = false;
                bld.append(part);
            }
            else {
                bld.append("?");
                int space = part.indexOf(' ');
                if (space > -1) {
                    names.add(part.substring(0, space));
                    bld.append(part.substring(space));
                }
                else {
                    names.add(part);
                }
            }
        }
        logger.info("Prepared sql: " + bld.toString());
        logger.info("Found names: " + names.toString());
        return bld.toString();
    }