public Connection getConnection() {
        if (connectiondb == null) {
            LoggingWindow.getInstance().addToLog("uuu database null");
            LoggingWindow.getInstance().addToLog("***" + "Opening new Database Connection" + "Database");
            try {
                if (USE_MYSQL) {
                    LoggingWindow.getInstance().addToLog("***" + "Using MySQL :" + DB + "Database");
                    Class.forName("com.mysql.jdbc.Driver");
                } else if (USE_MSSQL) {
                    LoggingWindow.getInstance().addToLog("***" + "Using MSSQL: " + DB + "Database");
                    Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
                } else if (USE_ODB) {
                    Class.forName("org.hsqldb.jdbcDriver");
                } else {
                    LoggingWindow.getInstance().addToLog("***" + "Using Microsoft JDBC ODBC Bridge : " + DB + "Database");
                    Class.forName("sun.jdbc.odbc.JdbcOdbc");
                }

            } catch (ClassNotFoundException cnfe) {
                JOptionPane.showMessageDialog(null, "Error Loading Driver: " + cnfe);
            }
            String urldb = "";
            try {
                urldb = getUrl();
                if (USE_MYSQL) {
                    connectiondb = DriverManager.getConnection(urldb, USER_NAME, PASSWORD);

                } else if (USE_MSSQL) {
                    connectiondb = DriverManager.getConnection(urldb, USER_NAME, PASSWORD);
                } else if (USE_ODB) {
                    connectiondb = DriverManager.getConnection(urldb, USER_NAME, PASSWORD);
                } else {
                    connectiondb = DriverManager.getConnection(urldb);//
                }
                LoggingWindow.getInstance().addToLog("***" + "Connection Established", "Database");
                //JOptionPane.showMessageDialog(null, "Koneksi terbuka");
            } catch (Exception e) {
                final String errMsg = "Error Database: Tidak dapat tersambung ke Basis data : " + DB + "\n" + e.getMessage() + "\n" + urldb;
                JOptionPane.showMessageDialog(Startup.getInstance().getMainFrame(), errMsg);
                System.out.println(errMsg);

            }
        }
        return connectiondb;
    }