Java Code Examples for org.apache.ibatis.datasource.pooled.PooledDataSource#setDriver()
The following examples show how to use
org.apache.ibatis.datasource.pooled.PooledDataSource#setDriver() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: BaseDataTest.java From mybaties with Apache License 2.0 | 5 votes |
public static PooledDataSource createPooledDataSource(String resource) throws IOException { Properties props = Resources.getResourceAsProperties(resource); PooledDataSource ds = new PooledDataSource(); ds.setDriver(props.getProperty("driver")); ds.setUrl(props.getProperty("url")); ds.setUsername(props.getProperty("username")); ds.setPassword(props.getProperty("password")); return ds; }
Example 2
Source File: BaseDb.java From live-chat-engine with Apache License 2.0 | 5 votes |
public static PooledDataSource createDataSource(Props p) { String url = p.findVal(db_url); PooledDataSource ds = new PooledDataSource(); ds.setDriver(p.findVal(db_driver)); ds.setUrl(url); ds.setUsername(p.findVal(db_user)); ds.setPassword(p.findVal(db_psw)); ds.setPoolMaximumActiveConnections(p.getIntVal(db_maxConnections)); ds.setPoolMaximumIdleConnections(p.getIntVal(db_idleConnections)); return ds; }
Example 3
Source File: BaseDataTest.java From mybatis with Apache License 2.0 | 5 votes |
public static PooledDataSource createPooledDataSource(String resource) throws IOException { Properties props = Resources.getResourceAsProperties(resource); PooledDataSource ds = new PooledDataSource(); ds.setDriver(props.getProperty("driver")); ds.setUrl(props.getProperty("url")); ds.setUsername(props.getProperty("username")); ds.setPassword(props.getProperty("password")); return ds; }