All Downloads are FREE. Search and download functionalities are using the official Maven repository.

backend.utils.DatabaseUtils Maven / Gradle / Ivy

There is a newer version: 1.2.3
Show newest version
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package backend.utils;

/**
 *
 * @author zua
 */
public class DatabaseUtils {

    private static DatabaseUtils instance;
    
    private DatabaseUtils() {
    }

    public static DatabaseUtils getInstance() {
        if (instance == null) {
            instance = new DatabaseUtils();
        }
        return instance;
    }

    public String wrapUp(String string) {
        if (string == null) {
            return null;
        }

        if (string.isEmpty()) {
            return "";
        }
        
        if(string.contains("\'")) {
            string = string.replace("\'", "`");
        }
        return "'" + string + "'";
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy