如何在java示例中创建连接池

时间:2016-09-14 07:09:58

标签: java oracle jdbc

文件db.properties包含网址,用户名和密码。

我的示例代码:

Properties DBProperties = new Properties();
Connection con = null;

DBProperties.load(
    new FileInputStream(
        System.getenv("Connection") + File.separator + "java" + File.separator + "properties" + File.separator + "db.properties"
    )
);

logger.info("DB url: " + DBProperties.getProperty("DBURL"));
logger.info("DB username: " + DBProperties.getProperty("DBUserName"));
logger.info("DB password: " + DBProperties.getProperty("DBPassword"));

0 个答案:

没有答案