proxool parameter :
alias
driver-url
driver-class
driver-properties
house-keeping-sleep-time:house keeper 保留线程处于睡眠状态的最长时间,house keeper 的职责就是检查各个连接的状态,并判断是否需要销毁或者创建
house-keeping-test-sql:如果发现了空闲的数据库连接.house keeper 将会用这个语句来测试.这个语句最好非常快的被执行.如果没有定义,测试过程将会被忽略。
maximum-connection-count
minimum-connection-count
maximum-connection-lifetime
maximum-new-connections
simultaneous-build-throttle
recently-started-threshold
overload-without-refusal-lifetime
maximum-active-time
fatal-sql-exception :它是一个逗号分割的信息片段,当一个SQL异常发生时,他的异常信息将与这个信息片段进行比较,如果在片段中存在,那么这个异常将被认为是个致命错误(Fatal SQL Exception )。这种情况下,数据库连接将要被放弃,无论发生什么,这个异常将会被重掷以提供给消费者。用户可以自己配置一个不同的异常来抛出
fatal-sql-exception-wrapper-class:正如上面所说,你配置一个不同的异常来重掷.利用这个属性,用户可以包装SQLException,使他变成另外一个异常.这个异常或者继承SQLException或者继承字RuntimeException.proxool自带了2个实现:'org.logicalcobwebs.proxool.FatalSQLException' 和'org.logicalcobwebs.proxool.FatalRuntimeException' .后者更合适.
prototype-count
statistics
statistics-log-level
trace
verbose
<?xml version="1.0" encoding="UTF-8"?>
<!ELEMENT proxool-config (proxool+)>
<!ELEMENT proxool (alias, driver-url, driver-class, driver-properties?, house-keeping-sleep-time?, house-keeping-test-sql?, maximum-connection-count?, minimum-connection-count?, maximum-connection-lifetime?, maximum-new-connections?, simultaneous-build-throttle?, recently-started-threshold?, overload-without-refusal-lifetime?, maximum-active-time?, verbose?, trace?, fatal-sql-exception*, prototype-count?, statistics?, statistics-log-level?)>
<!-- This is the alias for the pool -->
<!ELEMENT alias (#PCDATA)>
<!-- The delegate driver we are delegating to
(for instance, org.hsqldb.jdbcDriver) -->
<!ELEMENT driver-class (#PCDATA)>
<!-- The URL the delegate driver uses
(for instance, jdbc:hsqldb:test) -->
<!ELEMENT driver-url (#PCDATA)>
<!-- If the connection cound it less than this then the housekeeper will build some more
Defaults to zero. -->
<!ELEMENT minimum-connection-count (#PCDATA)>
<!-- The maximum amount of connections to the database. Defaults to 15. -->
<!ELEMENT maximum-connection-count (#PCDATA)>
<!-- Any idle connections older than this will be removed by the housekeeper (milliseconds).
Defaults to 4 * 60 * 60 * 1000 (4 hours). -->
<!ELEMENT maximum-connection-lifetime (#PCDATA)>
<!-- This is the maximum number of connections we can be building at any one time. That is,
the number of new connections that have been requested but aren't yet available for use.
Defaults to 10. -->
<!ELEMENT maximum-new-connections (#PCDATA)>
<!-- This is the maximum number of connections we can be building at any one time. That is,
the number of new connections that have been requested but aren't yet available for use.
Defaults to 10. -->
<!ELEMENT simultaneous-build-throttle (#PCDATA)>
<!-- How long the house keeping thread sleeps for (milliseconds). Defaults to
30000 (30 seconds) -->
<!ELEMENT house-keeping-sleep-time (#PCDATA)>
<!-- If the house keeping thread finds and idle connections it will test them with this SQL statement.
It should be _very_ quick to execute. Something like checking the current date or something. If
not defined then this test is omitted. -->
<!ELEMENT house-keeping-test-sql (#PCDATA)>
<!-- If there are fewer than this number of connections available then we will build some more
(assuming the maximum-connection-count is not exceeded). Defaults to zero. -->
<!ELEMENT prototype-count (#PCDATA)>
<!-- This helps us determine whether the pool status. As long as at least one connection was
started within this threshold (milliseconds) or there are some spare connections available
then we assume the pool is up. Defaults to 60 seconds. -->
<!ELEMENT recently-started-threshold (#PCDATA)>
<!-- This helps us determine the pool status. If we have refused a connection within this threshold
(milliseconds) then we are overloaded. Defaults to 60 seconds. -->
<!ELEMENT overload-without-refusal-lifetime (#PCDATA)>
<!-- If a connection is active for longer than this (milliseconds) then we assume it has stalled or
something. And we kill it. Defaults to 5 minutes. -->
<!ELEMENT maximum-active-time (#PCDATA)>
<!-- Either false (quiet) or true (loud). Default is false. -->
<!ELEMENT verbose (#PCDATA)>
<!-- If true then every execution will be logged. Default is false. -->
<!ELEMENT trace (#PCDATA)>
<!-- All SQLExceptions are caught and tested for containing this text fragment. If it matches than
this connection is considered useless and it is discarded. Regardless of what happens the
exception is always thrown again. This property behaves like a collection; you can set it more
than once and each value is checked. -->
<!ELEMENT fatal-sql-exception (#PCDATA)>
<!-- This contains all the properties that are passed onto the
delegate driver. -->
<!ELEMENT driver-properties (property*)>
<!-- Each property is a simple name-value pair. -->
<!ELEMENT property EMPTY>
<!ATTLIST property
name CDATA #REQUIRED
value CDATA #REQUIRED
>
<!-- The sample length when taking statistical information, comma-delimited. For example: '10s,15m'
would mean take samples every 10 seconds and every 15 minutes. Valid units are s(econds),
m(inutes), h(ours) and d(ays). Default is no statistics -->
<!ELEMENT statistics (#PCDATA)>
<!-- Whether statistics are logged as they are produced. Range: DEBUG, INFO, WARN, ERROR, FATAL.
Not to be confused with the level used with the general log. You have to configure that
separately. Default is no logging -->
<!ELEMENT statistics-log-level (#PCDATA)>
<!--
Revision history:
$Log: proxool.dtd,v $
Revision 1.5 2004/03/17 10:51:48 brenuart
Add statistics & statistics-log-level elements
Revision 1.4 2003/03/05 23:28:56 billhorsman
deprecated maximum-new-connections property in favour of
more descriptive simultaneous-build-throttle
Revision 1.3 2003/03/03 11:12:01 billhorsman
fixed licence
Revision 1.2 2003/01/23 10:41:05 billhorsman
changed use of pool-name to alias for consistency
Revision 1.1 2002/12/16 01:04:31 chr32
Moved from parent package.
Revision 1.3 2002/12/15 23:27:50 chr32
Clarified som names.
Revision 1.2 2002/12/11 01:13:15 billhorsman
with doc
Revision 1.1 2002/12/11 00:55:09 billhorsman
draft
-->
分享到:
相关推荐
在Spring的配置文件中,你可以根据实际需求设置上述提到的Proxool参数。 **关于proxool-0.9.1.jar和proxool-cglib.jar** `proxool-0.9.1.jar`是Proxool的库文件,包含了Proxool的所有类和功能,它是使用Proxool的...
5. **测试与调优**:编写测试用例,验证数据的增删改查是否正常,并根据性能需求调整Proxool参数。 在这个过程中,可能还会遇到一些问题,如事务管理、缓存配置、异常处理等。开发者需要熟悉Hibernate的API和配置,...
标题中的"proxool-0.9.1.jar"和"proxool-cglib.jar"是两个重要的Java档案文件,它们是Proxool项目的组件。Proxool是一个开源的数据库连接池解决方案,它允许开发者在Java应用程序中高效地管理数据库连接。数据库连接...
此外,还可以设置最大和最小连接数(`proxool.max-connections` 和 `proxool.min-connections`),连接超时时间(`proxool.house-keeping-test-sql`)等参数,以优化性能和资源利用率。 在实际使用中,Proxool 可以...
标题中的"proxool-0.9.1.jar"和"proxool_cglib-0.9.1.jar"是两个Java库文件,它们是Proxool项目在0.9.1版本时的实现。Proxool是一个开源的数据库连接池,它提供了一种灵活且高效的解决方案来管理数据库连接。在Java...
标题中的“hibernate3+ proxool-0.9.1配置”涉及到的是在Java开发中,使用Hibernate3 ORM框架与Proxool连接池的整合配置。...在实际项目中,根据具体需求调整连接池参数,可以进一步优化系统性能。
2. 配置Proxool的XML配置文件,设置连接池的参数,如最大连接数、最小连接数、超时时间等。 3. 在Java代码中,通过Proxool提供的API获取数据库连接,使用完毕后归还到连接池。 4. 可能会有一个静态块或者单例工厂来...
在Java项目中,我们需要创建一个配置文件(如`proxool.properties`),来定义数据库连接池的相关参数,例如: ``` proxool.pool-name=myPool proxool.driver-url=jdbc:mysql://localhost:3306/mydb proxool....
在使用Proxool时,开发者需要配置XML文件(如proxool.properties)来设置连接池的参数,例如数据库URL、用户名、密码、最大连接数、最小连接数等。然后,在应用程序中通过JNDI查找或直接初始化Proxool的DataSource...
同时,我们还引入了一个外部配置文件`ProxoolConf.xml`,用于设置Proxool的具体参数,如最大连接数、最小连接数、超时时间等。 `ProxoolConf.xml`配置示例如下: ```xml <proxool> <driver-url>jdbc:mysql://...
2. 配置`proxool.properties`:在项目中创建一个`proxool.properties`文件,定义数据库连接池的相关参数,如数据库URL、用户名、密码、最大连接数等。例如: ``` proxool.mysql.testdriver=com.mysql.jdbc.Driver ...
在实际应用中,开发人员通常会将Proxool的JAR包添加到项目的类路径中,然后通过配置文件设置连接池参数,并在代码中通过JDBC API创建和管理数据库连接。例如,使用`DriverManager.getConnection()`方法时,会自动...
2. 在Spring的配置文件中定义一个DataSource bean,使用Proxool的配置属性来指定连接池的参数,例如最大连接数、最小连接数、空闲连接存活时间等。 3. 配置数据库连接的相关属性,如URL、用户名、密码等。 4. 可以...
4. **Proxool属性详解**:上述配置中的属性如`maxActive`、`maxIdle`、`maxWait`和`timeToLive`都是Proxool的关键参数。`maxActive`定义了最大的活跃连接数,`maxIdle`是空闲连接的最大数量,`maxWait`是当所有连接...
Proxool的配置过程涉及多个方面,包括基本配置参数、连接池大小、超时设置等,下面我们将详细解析这些知识点。 1. **基本配置** 在配置Proxool时,我们需要在应用的配置文件(如`proxool.properties`)中定义连接...
在实际应用中,Proxool的配置通常包括设置连接池的最大连接数、最小连接数、超时时间等参数。这些参数可以根据系统的负载情况和数据库的处理能力进行调整,以达到最优的性能和资源利用。此外,Proxool还提供了监控和...
首先,需要在项目的资源配置文件(如`application.properties`或`config.xml`)中设置Proxool的相关参数,包括数据库URL、用户名、密码、最大连接数等。例如: ```xml <driver-url>jdbc:mysql://localhost:3306/...
配置 Hibernate 使用 `Proxool`,需要在 `hibernate.cfg.xml` 文件中添加相关配置,包括代理 URL、池大小等参数。例如: ```xml <property name="hibernate.connection.driver_class">...
- `src/main/resources`: 配置文件和资源文件,如proxool.properties,用于设置连接池参数。 - `src/test/java`: 测试代码,用于验证和测试Proxool的功能。 3. **核心组件** - **PoolConfig**: 连接池配置类,...