當前位置: 首頁>>代碼示例>>Java>>正文


Java ConnectionPoolDataSource.getLogWriter方法代碼示例

本文整理匯總了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();
}
 
開發者ID:stechy1,項目名稱:drd,代碼行數:24,代碼來源:MiniConnectionPoolManager.java

示例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();
}
 
開發者ID:jbeetle,項目名稱:BJAF3.x,代碼行數:27,代碼來源:MiniConnectionPoolManager.java

示例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();
}
 
開發者ID:fixteam,項目名稱:fixflow,代碼行數:26,代碼來源:MiniConnectionPoolManager.java

示例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
        }
    }
}
 
開發者ID:vdr007,項目名稱:ThriftyPaxos,代碼行數:11,代碼來源:JdbcConnectionPool.java

示例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(); }
 
開發者ID:mikkeliamk,項目名稱:osa,代碼行數:23,代碼來源:MiniConnectionPoolManager.java

示例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(); }
 
開發者ID:lathil,項目名稱:Ptoceti,代碼行數:23,代碼來源:MiniConnectionPoolManager.java


注:本文中的javax.sql.ConnectionPoolDataSource.getLogWriter方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。