getSQLValueString static method

String getSQLValueString(
  1. Object value,
  2. String type
)

Implementation

static String getSQLValueString(Object value,String type){
    String result=value.toString();
    if(type==typeString||type==typeDate||type==typeDateTime){
        result=result.replaceAll("'","''");
        result="'"+result+"'";
    }
    else{
        if(result.trim()==""){
            result="0";
        }
    }
    return result;
}