Package club.ui

Examples of club.ui.ConnectDBDialog


            DataConfig data = new DataConfig();
            ConfigBean bean = new ConfigBean();
            try{
                bean = data.readConfigFile();
            } catch(Exception e){
                (new ConnectDBDialog()).setVisible(true);
                return null;
            }
            Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
            String connectionUrl = "jdbc:sqlserver://" + bean.getDBServer()  + bean.getDBPort() + ";"
                    + "databaseName=" + bean.getDBName() + ";user=" + bean.getDBUser() + ";password=" + bean.getDBPass() + ";";
            conn = DriverManager.getConnection(connectionUrl);
        } catch (SQLException ex) {
            Logger.getLogger(ConnectDB.class.getName()).log(Level.SEVERE, null, ex);
            JOptionPane.showMessageDialog(null, "Connect Database is failed");
        } catch (NullPointerException e){
            JOptionPane.showMessageDialog(null, "Error reading file");
            (new ConnectDBDialog()).setVisible(true);
            return null;
        }
        return conn;
    }
View Full Code Here


        try{
            ConfigBean config = readConfigFile();
            if (IsValidDBInfo(config)){
                return true;
            } else{
                (new ConnectDBDialog()).setVisible(true);
                return false;
            }
        } catch(Exception e){
            (new ConnectDBDialog()).setVisible(true);
            return false;
        }
    }
View Full Code Here

TOP

Related Classes of club.ui.ConnectDBDialog

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.