public static Connection conn = null;
public static Connection connectMSDB() throws ClassNotFoundException {
try {
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){