Here you can find the source of quoted(String text)
public static String quoted(String text)
//package com.java2s; //License from project: Apache License public class Main { public static String quoted(String text) { return "'" + text.replaceAll("'", "''") + "'"; }//ww w.ja v a 2s .c o m }