本文整理汇总了Java中javax.sql.ConnectionPoolDataSource.getLogWriter方法的典型用法代码示例。如果您正苦于以下问题:Java ConnectionPoolDataSource.getLogWriter方法的具体用法?Java ConnectionPoolDataSource.getLogWriter怎么用?Java ConnectionPoolDataSource.getLogWriter使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.sql.ConnectionPoolDataSource
的用法示例。
在下文中一共展示了ConnectionPoolDataSource.getLogWriter方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: MiniConnectionPoolManager
import javax.sql.ConnectionPoolDataSource; //导入方法依赖的package包/类
/**
* Constructs a MiniConnectionPoolManager object.
*
* @param dataSource the data source for the connections.
* @param maxConnections the maximum number of connections.
* @param timeout the maximum time in seconds to wait for a free connection.
*/
public MiniConnectionPoolManager(ConnectionPoolDataSource dataSource, int maxConnections,
int timeout) {
this.dataSource = dataSource;
this.maxConnections = maxConnections;
this.timeoutMs = timeout * 1000L;
try {
logWriter = dataSource.getLogWriter();
} catch (SQLException e) {
}
if (maxConnections < 1) {
throw new IllegalArgumentException("Invalid maxConnections value.");
}
semaphore = new Semaphore(maxConnections, true);
recycledConnections = new LinkedList<PooledConnection>();
poolConnectionEventListener = new PoolConnectionEventListener();
}
示例2: MiniConnectionPoolManager
import javax.sql.ConnectionPoolDataSource; //导入方法依赖的package包/类
/**
* Constructs a MiniConnectionPoolManager object.
*
* @param dataSource
* the data source for the connections.
* @param maxConnections
* the maximum number of connections.
* @param timeout
* the maximum time in seconds to wait for a free connection.
*/
public MiniConnectionPoolManager(ConnectionPoolDataSource dataSource,
int maxConnections, int timeout) {
this.dataSource = dataSource;
this.maxConnections = maxConnections;
this.timeoutMs = timeout * 1000L;
try {
logWriter = dataSource.getLogWriter();
} catch (SQLException e) {
}
if (maxConnections < 1) {
throw new IllegalArgumentException("Invalid maxConnections value.");
}
semaphore = new Semaphore(maxConnections, true);
recycledConnections = new LinkedList<PooledConnection>();
poolConnectionEventListener = new PoolConnectionEventListener();
}
示例3: MiniConnectionPoolManager
import javax.sql.ConnectionPoolDataSource; //导入方法依赖的package包/类
/**
* Constructs a MiniConnectionPoolManager object.
*
* @param dataSource
* the data source for the connections.
* @param maxConnections
* the maximum number of connections.
* @param timeout
* the maximum time in seconds to wait for a free connection.
*/
public MiniConnectionPoolManager(ConnectionPoolDataSource dataSource, int maxConnections, int timeout) {
this.dataSource = dataSource;
this.maxConnections = maxConnections;
this.timeoutMs = timeout * 1000L;
try {
logWriter = dataSource.getLogWriter();
} catch (SQLException e) {
}
if (maxConnections < 1) {
throw new IllegalArgumentException("Invalid maxConnections value.");
}
semaphore = new Semaphore(maxConnections, true);
recycledConnections = new LinkedList<PooledConnection>();
poolConnectionEventListener = new PoolConnectionEventListener();
}
示例4: JdbcConnectionPool
import javax.sql.ConnectionPoolDataSource; //导入方法依赖的package包/类
protected JdbcConnectionPool(ConnectionPoolDataSource dataSource) {
this.dataSource = dataSource;
if (dataSource != null) {
try {
logWriter = dataSource.getLogWriter();
} catch (SQLException e) {
// ignore
}
}
}
示例5: MiniConnectionPoolManager
import javax.sql.ConnectionPoolDataSource; //导入方法依赖的package包/类
/**
* Constructs a MiniConnectionPoolManager object.
*
* @param dataSource
* the data source for the connections.
* @param maxConnections
* the maximum number of connections.
* @param timeout
* the maximum time in seconds to wait for a free connection.
*/
public MiniConnectionPoolManager (ConnectionPoolDataSource dataSource, int maxConnections, int timeout) {
this.dataSource = dataSource;
this.maxConnections = maxConnections;
this.timeoutMs = timeout * 1000L;
try {
logWriter = dataSource.getLogWriter(); }
catch (SQLException e) {}
if (maxConnections < 1) {
throw new IllegalArgumentException("Invalid maxConnections value."); }
semaphore = new Semaphore(maxConnections,true);
recycledConnections = new LinkedList<PooledConnection>();
poolConnectionEventListener = new PoolConnectionEventListener(); }
示例6: MiniConnectionPoolManager
import javax.sql.ConnectionPoolDataSource; //导入方法依赖的package包/类
/**
* Constructs a MiniConnectionPoolManager object.
*
* @param dataSource
* the data source for the connections.
* @param maxConnections
* the maximum number of connections.
* @param timeout
* the maximum time in seconds to wait for a free connection.
*/
public MiniConnectionPoolManager (ConnectionPoolDataSource dataSource, int maxConnections, int timeout) {
this.dataSource = dataSource;
this.maxConnections = maxConnections;
this.timeoutMs = timeout * 1000L;
try {
logWriter = dataSource.getLogWriter(); }
catch (SQLException e) {}
if (maxConnections < 1) {
throw new IllegalArgumentException("Invalid maxConnections value."); }
semaphore = new Semaphore(maxConnections,true);
recycledConnections = new LinkedList<PooledConnection>();
poolConnectionEventListener = new PoolConnectionEventListener(); }