properties配置文件
jdbc.driver=com.mysql.jdbc.Driver #jdbc.driver=org.logicalcobwebs.proxool.ProxoolDriver jdbc.url=jdbc\:mysql\://192.168.1.2\:3306/school jdbc.username=abc jdbc.password=123456 jdbc.dbname=student jdbc.show_sql=false jdbc.maximumConnectionLifetime=14400000 jdbc.minimumConnectionCount=20 jdbc.maximumConnectionCount=2000 jdbc.houseKeepingSleepTime=60000 jdbc.maximumActiveTime=600000
jar默认值:
maximumConnectionLifetime = 14400000L; prototypeCount = 0; minimumConnectionCount = 0; maximumConnectionCount = 15; houseKeepingSleepTime = 30000L; houseKeepingTestSql = null; simultaneousBuildThrottle = 10; recentlyStartedThreshold = 60000L; overloadWithoutRefusalLifetime = 60000L; maximumActiveTime = 300000L;
每一个属性的官方详细解释如下:
This is the full list of all the properties:
fatal-sql-exception:
A comma separated list of message fragments. When an SQLException occurs its message is compared to each of these fragments. If it contains any of them (case sensitive) then it is detected as a Fatal SQL Exception. This causes that connection to be discarded. Regardless of what happens, the exception is thrown again so that the user knows what has happened. You can optionally configure a different exception to be thrown (see fatal-sql-exception-wrapper-class property) Default is null.
fatal-sql-exception-wrapper-class:
If you have configured fatal-sql-exception then the default behaviour is to discard the exception that causes the fatal SQLException and then just throw the original exception to the user. Using this property you can wrap the SQLException up inside another exception. This exception can be anything you want as long as it either extends SQLException or RuntimeException. Proxool provides two classes which you can use if you don't want to build your own: FatalSQLException and FatalRuntimeException. To make use of those you should set this property to either 'org.logicalcobwebs.proxool.FatalSQLException' or 'org.logicalcobwebs.proxool.FatalRuntimeException' as appropriate. Default is null (fatal SQLExceptions are not wrapped). Default is null.
house-keeping-sleep-time:
How long the house keeping thread sleeps for (milliseconds). The house keeper is responsible for checking the state of all the connections and tests whether any need to be destroyed or created. Default is 30 seconds.
house-keeping-test-sql:
If the house keeping thread finds and idle connections it will test them with this SQL statement. It should bevery quick to execute. Something like checking the current date or something. If not defined then this test is omitted.
injectable-connection-interface:
Allows Proxool to implement methods defined in the delegate Connection object. See Injectable Interfaces.
injectable-statement-interface:
Allows Proxool to implement methods defined in the delegate Statement object. See Injectable Interfaces.
injectable-prepared-statement-interface:
Allows Proxool to implement methods defined in the delegate PreparedStatement object. See Injectable Interfaces.
injectable-callable-statement-interface:
Allows Proxool to implement methods defined in the delegate CallableStatement object. See Injectable Interfaces.
jmx:
If true the pool will be registered as an MBean to a JMX server with the following object name: "Proxool:type=Pool, name=<alias>". Default is false.
jmx-agent-id:
A comma separated list of JMX agent ids (as used by MBeanServerFactory.findMBeanServer(String agentId) ) to register the pool to. This property is only used if the "jmx" property is set to "true". All registered JMX servers will be used if this property is not set.
jndi-name:
See DataSource.
maximum-active-time:
If the housekeeper comes across a thread that has been active for longer than this then it will kill it. So make sure you set this to a number bigger than your slowest expected response! Default is 5 minutes.
maximum-connection-count:
The maximum number of connections to the database. Default is 15.
maximum-connection-lifetime:
The maximum amount of time that a connection exists for before it is killed (milliseconds). Default is 4 hours.
maximum-new-connections:
Deprecated. Use simultaneous-build-throttle instead.
minimum-connection-count:
The minimum number of connections we will keep open, regardless of whether anyone needs them or not. Default is 5.
overload-without-refusal-lifetime:
This helps us determine the pool status. If we have refused a connection within this threshold (milliseconds) then we are overloaded. Default is 60 seconds.
prototype-count:
If there are fewer than this number of connections available then we will build some more (assuming the maximum-connection-count is not exceeded). For example. Of we have 3 active connections and 2 available, but our prototype-count is 4 then it will attempt to build another 2. This differs from minimum-connection-count because it takes into account the number of active connections. minimum-connection-count is absolute and doesn't care how many are in use. prototype-count is the number of spare connections it strives to keep over and above the ones that are currently active. Default is 0.
recently-started-threshold:
This helps us determine whether the pool status is up, down or overloaded. 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. Default is 60 seconds.
simultaneous-build-throttle:
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. Because connections can be built using more than one thread (for instance, when they are built on demand) and it takes a finite time between deciding to build the connection and it becoming available we need some way of ensuring that a lot of threads don't all decide to build a connection at once. (We could solve this in a smarter way - and indeed we will one day) Default is 10.
statistics:
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 null (no statistics).
statistics-log-level:
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 null (no logging).
test-before-use:
If you set this to true then each connection is tested (with whatever is defined in house-keeping-test-sql) before being served. If a connection fails then it is discarded and another one is picked. If all connections fail a new one is built. If that one fails then you get an SQLException saying so.
test-after-use:
If you set this to true then each connection is tested (with whatever is defined in house-keeping-test-sql) after it is closed (that is, returned to the connection pool). If a connection fails then it is discarded.
trace:
If true then each SQL call gets logged (DEBUG level) along with the execution time. You can also get this information by registering a ConnectionListener (see ProxoolFacade). Default is false.
verbose:
Either false (quiet) or true (loud). Default is false.
相关推荐
本文将详细介绍Proxool数据库连接池及其监控功能,通过一个实际的实例来展示其工作原理和使用方法。 Proxool是Apache软件基金会的一个开源项目,它提供了一个轻量级、高性能的数据库连接池解决方案。Proxool与其他...
本篇文章将深入探讨Proxool数据库连接池的配置及其重要性。 首先,理解Proxool的基本概念是必要的。Proxool是Proxy + Pool的组合,它通过代理(Proxy)机制来管理数据库连接,使得应用程序可以透明地使用连接池。...
在Java环境下,Proxool.jar是使用Proxool数据库连接池服务的必备库文件。 首先,我们需要理解数据库连接池的工作原理。数据库连接池在初始化时会创建一定数量的数据库连接并保存在池中,当应用程序需要访问数据库时...
在Java中,有多种数据库连接池实现,包括C3P0、DBCP和Proxool等。 **C3P0连接池配置参数详解** 1. `acquireIncrement`:当连接池中的连接耗尽时,一次同时尝试获取的连接数。默认值为3,意味着如果连接池为空,它...
`Proxool数据库连接池配置.doc`应详细介绍了如何配置和使用Proxool,包括关键的配置参数及其作用。最后,`FCKeditor在线编译器.doc`可能会涵盖FCKeditor的安装、使用方法,以及如何集成自定义函数的教程。 总的来说...
Proxool是一个开源的、轻量级的Java数据库连接池实现,它提供了一种高效、灵活的方式来管理数据库连接。在某些场景下,为了保护敏感信息,如数据库的用户名和密码,我们需要对这些数据进行加密处理。"proxool连接池...
总结,使用Proxool配置MySQL数据库连接池,不仅可以解决8小时连接超时问题,还可以提升应用程序的性能和稳定性。通过详细配置Proxool,我们可以灵活地调整连接池参数以适应不同应用场景的需求,并通过集成到Tomcat,...
### 数据库连接池-连接的关闭内幕 在深入探讨数据库连接池中连接关闭的问题之前,我们首先需要了解数据库连接池的基本概念以及它在现代应用程序中的重要性。数据库连接池是一种管理多个数据库连接的方法,旨在提高...
Proxool是SSH框架中常用的数据库连接池之一,以其轻量级、灵活配置和优秀的性能表现而受到青睐。 数据库连接池的基本原理是预先在内存中创建一定数量的数据库连接,应用程序在需要时可以从池中获取连接,使用完毕后...
Proxool是一个开源的轻量级Java数据库连接池实现,其主要目标是替代常见的数据库连接池解决方案,如C3P0或DBCP,并且提供了更加灵活和易于配置的特性。在实际应用中,合理配置Proxool可以显著提高系统的性能和稳定性...
本文将深入解析几种常用的数据库连接池——Apache DBCP、C3P0、Proxool、BoneCP的详细配置参数,帮助开发者更好地理解和应用这些技术。 ### Apache DBCP **dataSource**: 配置数据源,通常在应用服务器的配置文件...
Proxool是其中一个轻量级、开源的数据库连接池实现,它提供了灵活的配置和监控功能。 Proxool的工作原理: 1. 当应用程序需要数据库连接时,不再直接创建新的连接,而是从连接池中获取已经建立好的连接。 2. 如果...
**Hibernate Proxool连接池配置详解** 在Java应用程序中,数据库连接池是管理数据库连接的一种高效方式,它可以显著提升系统性能,减少数据库资源的浪费。本文将深入探讨Hibernate与Proxool连接池的配置,以及在...
-- 连接池的别名 --> <alias>DBPool</alias> - <!-- proxool只能管理由自己产生的连接 --> <driver-url>jdbc:sqlserver://localhost:1433;dataBaseName=books</driver-url> - <!-- JDBC驱动程序 --> ...
Proxool是一个轻量级的数据库连接池,它通过SSH(Spring、Struts、Hibernate)框架进行集成,可以有效地管理和优化数据库连接。下面我们将深入探讨基于SSH的Proxool连接池配置。 首先,配置环境:MyEclipse5.5,...
proxool-0.9.1(my).jar 包是我修改了proxool-0.9.1后的jar包,修改后可以完全支持spring配置,并添加了charSet配置属性,用于配置数据库链接的设置默认字符集,并且解决了proxool数据库连接池报如下错误的问题:...
Proxool是Apache Software Foundation开发的一个开源数据库连接池实现,它在Java环境中广泛使用,以提升应用的性能和资源利用率。 在传统的JDBC编程中,每次需要与数据库交互时,都需要创建一个新的连接,执行完SQL...
Proxool是Apache的一个开源项目,它提供了一个轻量级的数据库连接池实现。本篇将详细介绍如何在Hibernate中配置Proxool连接池。 首先,我们需要在Spring的配置文件`applicationContext.xml`中设置SessionFactory ...