public void openConnection() {
        try {
            String url;
            if (mysql) {
                Class.forName("com.mysql.jdbc.Driver");
                url = "jdbc:mysql://" + mysql_address
                        + ":" + mysql_port
                        + "/" + databasename
                        + "?user=" + mysql_user
                        + "&password=" + mysql_pass;
            } else {
                Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
                url = "jdbc:sqlserver://" + sqlexpress_address
                        + "\\" + sqlexpress_instance
                        + ";databaseName=" + databasename
                        + ";userName=" + sqlexpress_user
                        + ";password=" + sqlexpress_pass;
            }
            DriverManager.setLoginTimeout(15);
            connection = DriverManager.getConnection(url);
        } catch (Exception ex) {
            Utils.showMessage("Kon geen verbinding met de database maken...\nProbeer het later nog eens of neem contact op met Joke Terol.", "Database fout.", ex.getMessage(), true);
        }
    }