public DBUtil getDbUtil () throws Exception { return new DBUtil(getJDBCUrl(), getUserName(), getPassword(), getDriver()); }
public static void executeSQL(String sql) throws Exception { DBUtil dbUtil = new DBUtil(getJDBCUrl(), getUserName(), getPassword(), getDriver()); dbUtil.executeSQL(sql); }
public static void waitTillServerStarts() { DBUtil dbUtil = null; try { dbUtil = new DBUtil(getJDBCUrl(), getUserName(), getPassword(), getDriver()); } catch (Exception e) { // ignore } Connection connection = null; try { if (dbUtil != null) { connection = dbUtil.getConnection(); } } catch (Throwable e) { // ignore } while (connection == null) { try { Thread.sleep(1000); try { if (dbUtil != null) { connection = dbUtil.getConnection(); } } catch (SQLException e) { // ignore } } catch (InterruptedException e) { // ignore } } }