DBコネクションとSQL読み込みルートパスを指定してSqlConfigを取得する

@param conn DBコネクション
@param loadPath SQLファイルの読み込みルートパス
@return SqlConfigオブジェクト
480877
public static SqlConfig getConfig(final Connection conn, final String loadPath) {
		return new DefaultSqlConfig(new DefaultConnectionSupplierImpl(conn), loadPath);
	}
427113
public Configuration fromFile(File path) throws ConfigurationLoadException {
    PropertiesConfiguration configuration = setupConfiguration(new PropertiesConfiguration());
    configuration.setFile(path);
    try {
      configuration.load();
      return configuration;
    } catch (ConfigurationException e) {
      throw new ConfigurationLoadException(
          "Encountered a problem reading the provided configuration file \"" + path + "\"!", e);
    }
  }
515856
def load(self, filepath):
        
        try:
            self._config.read(filepath)
            self.long_running_operation_timeout = self._config.getint(
                "Azure", "long_running_operation_timeout")
        except (ValueError, EnvironmentError, NoOptionError):
            msg = "Supplied config file incompatible"
            raise_with_traceback(ValueError, msg)
        finally:
            self._clear_config()
        return super(AzureConfiguration, self).load(filepath)
1374421
public function loadDbFixture(string $fixturePath)
    {
        list($fixtureFormat, $fixtureData) = $this->loadFixtureData($fixturePath);

        // Postpone database connection till we really need it.
        $this->db->dbConnect();

        $this->db->dbLoadFixture($fixtureFormat, $fixtureData);
    }
556345
public static String getIndexName (Connection conn, String table,
                                       String column)
        throws SQLException
    {
        ResultSet rs = conn.getMetaData().getIndexInfo("", "", table, false, true);
        while (rs.next()) {
            String tname = rs.getString("TABLE_NAME");
            String cname = rs.getString("COLUMN_NAME");
            String iname = rs.getString("INDEX_NAME");
            if (tname.equals(table) && cname.equals(column)) {
                return iname;
            }
        }
        return null;
    }
565406
protected int getStartValue(Connection con)
   {

      Statement stmt = null;
      ResultSet trs = null;
      try
      {
         String query;

         String tableItem = DBInitializerHelper.getItemTableName(containerConfig);
         if (JDBCUtils.tableExists(tableItem, con))
         {
            query = "select max(N_ORDER_NUM) from " + tableItem;
         }
         else
         {
            return -1;
         }
         stmt = con.createStatement();
         trs = stmt.executeQuery(query);
         if (trs.next() && trs.getInt(1) >= 0)
         {
            return trs.getInt(1);
         }
         else
         {
            return -1;
         }

      }
      catch (SQLException e)
      {
         if (LOG.isDebugEnabled())
         {
            LOG.debug("SQLException occurred while calculate the sequence start value", e);
         }
         return -1;
      }
      finally
      {
         JDBCUtils.freeResources(trs, stmt, null);
      }
   }
1327208
protected ConfigWebImpl getConfigWebImpl(String realpath) {
	Iterator<String> it = initContextes.keySet().iterator();
	while (it.hasNext()) {
	    ConfigWebImpl cw = ((CFMLFactoryImpl) initContextes.get(it.next())).getConfigWebImpl();
	    if (ReqRspUtil.getRootPath(cw.getServletContext()).equals(realpath)) return cw;
	}
	return null;
    }
899735
public static List<String> loadScript(String path) {
        List<String> result = new ArrayList<String>();
        URL url = CassandraUtils.class.getResource(path);
        LOGGER.debug(url.toString());
        LOGGER.info("Loading script from: " + url);
        try (BufferedReader br = new BufferedReader(new InputStreamReader(
                url.openStream(), "UTF8"))) {
            String line;
            while ((line = br.readLine()) != null) {
                if (line.length() > 0 && !line.startsWith("#")) {
                    result.add(line);
                }
            }
        } catch (IOException e) {
            LOGGER.error("IO Exception loading a cql script", e);
        }
        return result;
    }
585073
public static String loadAndGet (String loaderPath, String key)
    {
        try {
            Properties props = ConfigUtil.loadProperties(loaderPath);
            return props.getProperty(key);
        } catch (IOException ioe) {
            return null;
        }
    }
1198344
public void load(String filePath, ControlOverrides overrides) {
        try {
            config = new ZapXmlConfiguration(filePath);
            if (overrides != null) {
                for (Entry<String,String> entry : overrides.getOrderedConfigs().entrySet()) {
                	logger.info("Setting config " + entry.getKey() + " = " + entry.getValue() + 
                			" was " + config.getString(entry.getKey()));
                	config.setProperty(entry.getKey(), entry.getValue());
                }
            }
            parse();
        } catch (Exception e) {
            logger.error(e.getMessage(), e);
        }
	}
939207
public static SqlConfig getConfig(final String dataSourceName) {
		DataSourceConnectionSupplierImpl connectionSupplier = new DataSourceConnectionSupplierImpl(dataSourceName);
		return new DefaultSqlConfig(connectionSupplier, null);
	}
666114
@Override
    public String[] readLine(int line, boolean readResult) throws TechnicalException {
        String sqlRequest;
        try {
            final Path file = Paths.get(dataInPath + scenarioName + ".sql");
            sqlRequest = new String(Files.readAllBytes(file), Charset.forName(Constants.DEFAULT_ENDODING));
            sqlSanitized4readOnly(sqlRequest);
        } catch (final IOException e) {
            throw new TechnicalException(Messages.getMessage(TechnicalException.TECHNICAL_ERROR_MESSAGE) + e.getMessage(), e);
        }
        try (Connection connection = getConnection(); PreparedStatement statement = connection.prepareStatement(sqlRequest); ResultSet rs = statement.executeQuery();) {
            final String[] ret = readResult ? new String[columns.size()] : new String[columns.size() - 1];
            if (line == 0) {
                for (int i = 0; i < ret.length; i++) {
                    ret[i] = columns.get(i);
                }
            } else {
                while (rs.next() && rs.getRow() < line) {
                }
                for (int i = 1; i <= ret.length; i++) {
                    ret[i - 1] = rs.getString(i);
                }
            }
            return ret;
        } catch (final SQLException e) {
            logger.debug("In DBDataProvider, this catch aims for testing the end of provided data. DBDataProvider.readLine({}, {})", line, readResult, e);
            return null;
        }
    }
658163
public static String get(String subPath) {
        String dataStr = null;
        try {
            dataStr = loadingCache.get(subPath).snd;
        } catch (ExecutionException e) {
            LOG.error(e);
        }
        return dataStr;
    }
199511
public final Cursor<T> select (Connection conn, String condition)
    {
        String query = "select " + listOfFields + " from " + name +
            " " + condition;
        return new Cursor<T>(this, conn, query);
    }
771742
public static SqlConfig getConfig(final String url, final String user, final String password, final String schema,
			final boolean autoCommit, final boolean readOnly) {
		return new DefaultSqlConfig(new JdbcConnectionSupplierImpl(url, user, password, schema, autoCommit, readOnly),
				null);
	}
877769
private SqlInfo doBuildSqlInfo(BuildSource source, String valueText) {
        SqlInfo sqlInfo = source.getSqlInfo();
        Node node = source.getNode();
        this.concatSqlText(node, sqlInfo);
        return XmlSqlInfoBuilder.newInstace(source).buildTextSqlParams(valueText);
    }
271792
public static Properties loadProperties(String filePath) throws MnoConfigurationException {
		Properties properties = new Properties();
		InputStream input = getInputStreamFromClassPathOrFile(filePath);
		try {
			properties.load(input);
		} catch (IOException e) {
			throw new MnoConfigurationException("Could not load properties file: " + filePath, e);
		} finally {
			IOUtils.closeQuietly(input);
		}
		return properties;
	}