Here you can find the source of substituteSql(String template, Map
public static String substituteSql(String template, Map<String, String> map)
//package com.java2s; //License from project: Open Source License import java.util.Iterator; import java.util.Map; public class Main { public static String substituteSql(String template, Map<String, String> map) { Iterator<Map.Entry<String, String>> itMap = map.entrySet().iterator(); while (itMap.hasNext()) { Map.Entry<String, String> entry = itMap.next(); template = template.replace("{" + entry.getKey() + "}", "" + entry.getValue()); }//from w w w . ja v a2s . c o m return template; } }