/** * A convenience overload of {@link #loadProperties(String, ClassLoader)} * that uses the current thread's context classloader. */ public static Properties loadProperties(final String name) { return loadProperties(name, Thread.currentThread().getContextClassLoader()); } private static final boolean THROW_ON_LOAD_FAILURE = true;
@Deprecated private static Connection getConfigurationDB_NONPOOLED_Connection_FAILOVER() { try { Properties prop = PropertyLoader.loadProperties(PropertyFilePath); Driver d = (Driver) Class.forName(prop.getProperty(DBdriver)).newInstance(); DriverManager.registerDriver(d); Connection con = DriverManager.getConnection( prop.getProperty(ConfigDBURL_FAILOVER), prop.getProperty(ConfigUsername_FAILOVER), DE(prop.getProperty(ConfigPassword_FAILOVER))); PreparedStatement com = con.prepareStatement("select 1;"); try { com.execute(); DBUtils.safeClose(com); return con; } catch (Exception e) { log.log(Level.FATAL, "Error obtaining failover config database connection, attempting alternate. msg:" + e.getLocalizedMessage(), e); return null; } finally { DBUtils.safeClose(com); } } catch (Exception ex) { log.log(Level.FATAL, "Error obtaining primary conf database connection:" + ex.getLocalizedMessage(), ex); return null; } }
@Deprecated private static Connection getPerformanceDB_NONPOOLED_Connection_FAILOVER() { try { Properties prop = PropertyLoader.loadProperties(PropertyFilePath); Driver d = (Driver) Class.forName(prop.getProperty(DBdriver)).newInstance(); DriverManager.registerDriver(d); Connection con = DriverManager.getConnection( prop.getProperty(PerformanceDBURL_FAILOVER), prop.getProperty(PerformanceUsername_FAILOVER), DE(prop.getProperty(PerformancePassword_FAILOVER))); PreparedStatement com = con.prepareStatement("select 1;"); try { com.execute(); DBUtils.safeClose(com); return con; } catch (Exception e) { log.log(Level.FATAL, "Error obtaining secondary perf database connection, msg:" + e.getLocalizedMessage(), e); return null; } finally { DBUtils.safeClose(com); } } catch (Exception ex) { log.log(Level.FATAL, "No connection to the secondary database could be made, msg:" + ex.getLocalizedMessage(), ex); return null; } }
public static Connection getConfigurationDB_NONPOOLED_Connection() { try { Properties prop = PropertyLoader.loadProperties(PropertyFilePath); Driver d = (Driver) Class.forName(prop.getProperty(DBdriver)).newInstance(); DriverManager.registerDriver(d);
public static Connection getPerformanceDB_NONPOOLED_Connection() { try { Properties prop = PropertyLoader.loadProperties(PropertyFilePath); Driver d = (Driver) Class.forName(prop.getProperty(DBdriver)).newInstance(); DriverManager.registerDriver(d);
prop = PropertyLoader.loadProperties("org/miloss/fgsms/agentcore/fgsms-agent"); log.log(Level.INFO, "Agent configuration loaded from embedded config file within fgsms-agentCore.jar. Use -Dorg.miloss.fgsms.agentConfigFileOverride=path/to/config.properties to override or include the file fgsms-agent.properties in the classpath." + Constants.Version); } catch (Exception ex) {
Properties prop = PropertyLoader.loadProperties("fgsmsqpidjmx/connection");