Here you can find the source of quoteString(String string)
public static String quoteString(String string)
//package com.java2s; //License from project: Apache License public class Main { public static String quoteString(String string) { return "'" + escapeQuote(string) + "'"; }//from w ww. ja va 2s . co m public static String escapeQuote(String string) { return string.replaceAll("'", "''"); } }