@Test public void testIsConnectable() throws Exception { OracleDatasource oracleDatasource = new OracleDatasource(); oracleDatasource.setHost("172.18.1.112"); oracleDatasource.setPort(1521); oracleDatasource.setService("orcl"); oracleDatasource.setUser("test"); oracleDatasource.setPassword("test"); oracleDatasource.isConnectable(); }
@Override public void isConnectable() throws Exception { Connection con = null; try { Class.forName("oracle.jdbc.driver.OracleDriver"); String address = MessageFormat.format("jdbc:oracle:thin:@ con = DriverManager.getConnection(address, this.user, this.password); } finally { if (con != null) { try { con.close(); } catch (SQLException e) { logger.error("Orcale datasource try conn close conn error", e); throw e; } } } }
OracleDatasource extends Datasource { @Override public void isConnectable() throws Exception { Connection con = null; try { Class.forName("oracle.jdbc.driver.OracleDriver"); String address = MessageFormat.format("jdbc:oracle:thin:@ con = DriverManager.getConnection(address, this.user, this.password); } finally { if (con != null) { try { con.close(); } catch (SQLException e) { logger.error("Orcale datasource try conn close conn error", e); throw e; } } } } }
OracleDatasource extends Datasource { @Override public void isConnectable() throws Exception { Connection con = null; try { Class.forName("oracle.jdbc.driver.OracleDriver"); String address = MessageFormat.format("jdbc:oracle:thin:@ con = DriverManager.getConnection(address, this.user, this.password); } finally { if (con != null) { try { con.close(); } catch (SQLException e) { logger.error("Orcale datasource try conn close conn error", e); throw e; } } } }  }
OracleDatasource extends Datasource { @Override public void isConnectable() throws Exception { Connection con = null; try { Class.forName("oracle.jdbc.driver.OracleDriver"); String address = MessageFormat.format("jdbc:oracle:thin:@ con = DriverManager.getConnection(address, this.user, this.password); } finally { if (con != null) { try { con.close(); } catch (SQLException e) { logger.error("Orcale datasource try conn close conn error", e); throw e; } } } }  static Logger getLogger(); static void setLogger(Logger logger); String getHost(); void setHost(String host); int getPort(); void setPort(int port); String getService(); void setService(String service); String getUser(); void setUser(String user); String getPassword(); void setPassword(String password); @Override void isConnectable(); }
OracleDatasource extends Datasource { @Override public void isConnectable() throws Exception { Connection con = null; try { Class.forName("oracle.jdbc.driver.OracleDriver"); String address = MessageFormat.format("jdbc:oracle:thin:@ con = DriverManager.getConnection(address, this.user, this.password); } finally { if (con != null) { try { con.close(); } catch (SQLException e) { logger.error("Orcale datasource try conn close conn error", e); throw e; } } } }  static Logger getLogger(); static void setLogger(Logger logger); String getHost(); void setHost(String host); int getPort(); void setPort(int port); String getService(); void setService(String service); String getUser(); void setUser(String user); String getPassword(); void setPassword(String password); @Override void isConnectable();  }