[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-3954":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":17,"stars7d":18,"stars30d":19,"stars90d":16,"forks30d":16,"starsTrendScore":20,"compositeScore":21,"rankGlobal":10,"rankLanguage":10,"license":22,"archived":23,"fork":23,"defaultBranch":24,"hasWiki":25,"hasPages":23,"topics":26,"createdAt":10,"pushedAt":10,"updatedAt":31,"readmeContent":32,"aiSummary":33,"trendingCount":16,"starSnapshotCount":16,"syncStatus":17,"lastSyncTime":34,"discoverSource":35},3954,"HikariCP","brettwooldridge\u002FHikariCP","brettwooldridge","光 HikariCP・A solid, high-performance, JDBC connection pool at last.","",null,"Java",21113,3007,692,512,0,2,5,20,8,78.5,"Apache License 2.0",false,"dev",true,[27,28,29,30],"connection-pool","high-performance","java","jdbc","2026-06-12 04:00:20","\u003Ch1>\u003Cimg src=\"https:\u002F\u002Fgithub.com\u002Fbrettwooldridge\u002FHikariCP\u002Fwiki\u002FHikari.png\"> HikariCP\u003Csup>\u003Csup>&nbsp;It's Faster.\u003C\u002Fsup>\u003C\u002Fsup>\u003Csub>\u003Csub>\u003Csup>Hi·ka·ri [hi·ka·'lē] &#40;\u003Ci>Origin: Japanese\u003C\u002Fi>): light; ray.\u003C\u002Fsup>\u003C\u002Fsub>\u003C\u002Fsub>\u003C\u002Fh1>\u003Cbr>\n\n[![][Build Status img]][Build Status]\n[![][Coverage Status img]][Coverage Status]\n[![][license img]][license]\n![Maven Central Version](https:\u002F\u002Fimg.shields.io\u002Fmaven-central\u002Fv\u002Fcom.zaxxer\u002FHikariCP?label=maven%20central&link=https%3A%2F%2Fcentral.sonatype.com%2Fartifact%2Fcom.zaxxer%2FHikariCP)\n[![][Javadocs img]][Javadocs]\n[![][Librapay img]][Librapay]\n\nFast, simple, reliable.  HikariCP is a \"zero-overhead\" production ready JDBC connection pool.  At roughly 165Kb, the library is very light.  Read about [how we do it here](https:\u002F\u002Fgithub.com\u002Fbrettwooldridge\u002FHikariCP\u002Fwiki\u002FDown-the-Rabbit-Hole).\n\n&nbsp;&nbsp;&nbsp;\u003Csup>**\"Simplicity is prerequisite for reliability.\"**\u003Cbr>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;- *Dr. Edsger Dijkstra*\u003C\u002Fsup>\n\n----------------------------------------------------\n\n> [!IMPORTANT]\n> In order to avoid a rare condition where the pool goes to zero and does not recover it is necessary to configure *TCP keepalive*. Some JDBC drivers support this via properties, for example ``tcpKeepAlive=true`` on PostgreSQL, but in any case it can also be configured at the OS-level. See [Setting OS TCP Keepalive](https:\u002F\u002Fgithub.com\u002Fbrettwooldridge\u002FHikariCP\u002Fwiki\u002FSetting-Driver-or-OS-TCP-Keepalive) and\u002For [TCP keepalive for a better PostgreSQL experience](https:\u002F\u002Fwww.cybertec-postgresql.com\u002Fen\u002Ftcp-keepalive-for-a-better-postgresql-experience\u002F#setting-tcp-keepalive-parameters-on-the-operating-system).\n\n----------------------------------------------------\n\n### Index\n* [Artifacts](#artifacts)\n* [JMH Benchmarks](#checkered_flag-jmh-benchmarks)\n* [Analyses](#microscope-analyses)\n  * [Spike Demand Pool Comparison](#spike-demand-pool-comparison)\n  * [You're probably doing it wrong](#youre-probably-doing-it-wrong)\n  * [WIX Engineering Analysis](#wix-engineering-analysis)\n  * [Failure: Pools behaving badly](#failure-pools-behaving-badly)\n* [User Testimonials](#family-user-testimonials) \u003Cbr>\n* [Configuration](#gear-configuration-knobs-baby) \u003Cbr>\n  * [Essentials](#essentials)\n  * [Frequently used](#frequently-used)\n  * [Infrequently used](#infrequently-used)\n* [Initialization](#rocket-initialization)\n\n----------------------------------------------------\n\n### Artifacts\n\n_**Java 11+** maven artifact:_\n```xml\n\u003Cdependency>\n   \u003CgroupId>com.zaxxer\u003C\u002FgroupId>\n   \u003CartifactId>HikariCP\u003C\u002FartifactId>\n   \u003Cversion>7.0.2\u003C\u002Fversion>\n\u003C\u002Fdependency>\n```\n_Java 8 maven artifact (*deprecated*):_\n```xml\n\u003Cdependency>\n   \u003CgroupId>com.zaxxer\u003C\u002FgroupId>\n   \u003CartifactId>HikariCP\u003C\u002FartifactId>\n   \u003Cversion>4.0.3\u003C\u002Fversion>\n\u003C\u002Fdependency>\n```\n_Java 7 maven artifact (*deprecated*):_\n```xml\n\u003Cdependency>\n   \u003CgroupId>com.zaxxer\u003C\u002FgroupId>\n   \u003CartifactId>HikariCP-java7\u003C\u002FartifactId>\n   \u003Cversion>2.4.13\u003C\u002Fversion>\n\u003C\u002Fdependency>\n```\n_Java 6 maven artifact (*deprecated*):_\n```xml\n\u003Cdependency>\n   \u003CgroupId>com.zaxxer\u003C\u002FgroupId>\n   \u003CartifactId>HikariCP-java6\u003C\u002FartifactId>\n   \u003Cversion>2.3.13\u003C\u002Fversion>\n\u003C\u002Fdependency>\n```\nOr [download from here](http:\u002F\u002Fsearch.maven.org\u002F#search%7Cga%7C1%7Ccom.zaxxer.hikaricp).\n\n----------------------------------------------------\n\n### :checkered_flag: JMH Benchmarks\n\nMicrobenchmarks were created to isolate and measure the overhead of pools using the [JMH microbenchmark framework](http:\u002F\u002Fopenjdk.java.net\u002Fprojects\u002Fcode-tools\u002Fjmh\u002F). You can checkout the [HikariCP benchmark project for details](https:\u002F\u002Fgithub.com\u002Fbrettwooldridge\u002FHikariCP-benchmark) and review\u002Frun the benchmarks yourself.\n\n![](https:\u002F\u002Fgithub.com\u002Fbrettwooldridge\u002FHikariCP\u002Fwiki\u002FHikariCP-bench-2.6.0.png)\n\n * One *Connection Cycle* is defined as single ``DataSource.getConnection()``\u002F``Connection.close()``.\n * One *Statement Cycle* is defined as single ``Connection.prepareStatement()``, ``Statement.execute()``, ``Statement.close()``.\n\n\u003Csup>\n\u003Csup>1\u003C\u002Fsup> Versions: HikariCP 2.6.0, commons-dbcp2 2.1.1, Tomcat 8.0.24, Vibur 16.1, c3p0 0.9.5.2, Java 8u111 \u003Cbr\u002F>\n\u003Csup>2\u003C\u002Fsup> Intel Core i7-3770 CPU @ 3.40GHz \u003Cbr\u002F>\n\u003Csup>3\u003C\u002Fsup> Uncontended benchmark: 32 threads\u002F32 connections, Contended benchmark: 32 threads, 16 connections \u003Cbr\u002F>\n\u003Csup>4\u003C\u002Fsup> Apache Tomcat fails to complete the Statement benchmark when the Tomcat \u003Ci>StatementFinalizer\u003C\u002Fi> is used \u003Ca href=\"https:\u002F\u002Fraw.githubusercontent.com\u002Fwiki\u002Fbrettwooldridge\u002FHikariCP\u002Fmarkdown\u002FTomcat-Statement-Failure.md\">due to excessive garbage collection times\u003C\u002Fa>\u003Cbr\u002F>\n\u003Csup>5\u003C\u002Fsup> Apache DBCP fails to complete the Statement benchmark \u003Ca href=\"https:\u002F\u002Fraw.githubusercontent.com\u002Fwiki\u002Fbrettwooldridge\u002FHikariCP\u002Fmarkdown\u002FDbcp2-Statement-Failure.md\">due to excessive garbage collection times\u003C\u002Fa>\n\u003C\u002Fsup>\n\n----------------------------------------------------\n### :microscope: Analyses\n\n#### Spike Demand Pool Comparison\n\u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fbrettwooldridge\u002FHikariCP\u002Fblob\u002Fdev\u002Fdocuments\u002FWelcome-To-The-Jungle.md\">\u003Cimg width=\"400\" align=\"right\" src=\"https:\u002F\u002Fgithub.com\u002Fbrettwooldridge\u002FHikariCP\u002Fwiki\u002FSpike-Hikari.png\">\u003C\u002Fa>\nAnalysis of HikariCP v2.6, in comparison to other pools, in relation to a unique \"spike demand\" load.\n\nThe customer's environment imposed a high cost of new connection acquisition, and a requirement for a dynamically-sized pool, but yet a need for responsiveness to request spikes.  Read about the spike demand handling [here](https:\u002F\u002Fgithub.com\u002Fbrettwooldridge\u002FHikariCP\u002Fblob\u002Fdev\u002Fdocuments\u002FWelcome-To-The-Jungle.md).\n\u003Cbr\u002F>\n\u003Cbr\u002F>\n#### You're [probably] doing it wrong\n\u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fbrettwooldridge\u002FHikariCP\u002Fwiki\u002FAbout-Pool-Sizing\">\u003Cimg width=\"200\" align=\"right\" src=\"https:\u002F\u002Fgithub.com\u002Fbrettwooldridge\u002FHikariCP\u002Fwiki\u002FPostgres_Chart.png\">\u003C\u002Fa>\nAKA *\"What you probably didn't know about connection pool sizing\"*.  Watch a video from the Oracle Real-world Performance group, and learn about why database connections do not need to be so numerous as they often are. In fact, too many connections have a clear and demonstrable *negative* impact on performance; a 50x difference in the case of the Oracle demonstration.  [Read on to find out](https:\u002F\u002Fgithub.com\u002Fbrettwooldridge\u002FHikariCP\u002Fwiki\u002FAbout-Pool-Sizing).\n\u003Cbr\u002F>\n#### WIX Engineering Analysis\n\u003Ca href=\"https:\u002F\u002Fwww.wix.engineering\u002Fblog\u002Fhow-does-hikaricp-compare-to-other-connection-pools\">\u003Cimg width=\"180\" align=\"left\" src=\"https:\u002F\u002Fgithub.com\u002Fbrettwooldridge\u002FHikariCP\u002Fwiki\u002FWix-Engineering.png\">\u003C\u002Fa>\nWe'd like to thank the guys over at WIX for the unsolicited and deep write-up about HikariCP on their [engineering blog](https:\u002F\u002Fwww.wix.engineering\u002Fpost\u002Fhow-does-hikaricp-compare-to-other-connection-pools).  Take a look if you have time.\n\u003Cbr\u002F>\n\u003Cbr\u002F>\n\u003Cbr\u002F>\n#### Failure: Pools behaving badly\nRead our interesting [\"Database down\" pool challenge](https:\u002F\u002Fgithub.com\u002Fbrettwooldridge\u002FHikariCP\u002Fwiki\u002FBad-Behavior:-Handling-Database-Down).\n\n----------------------------------------------------\n#### \"Imitation Is The Sincerest Form Of Plagiarism\" - \u003Csub>\u003Csup>anonymous\u003C\u002Fsup>\u003C\u002Fsub>\nOpen source software like HikariCP, like any product, competes in the free market.  We get it.  We understand that product advancements, once public, are often co-opted.  And we understand that ideas can arise from the zeitgeist; simultaneously and independently.  But the timeline of innovation, particularly in open source projects, is also clear and we want our users to understand the direction of flow of innovation in our space.  It could be demoralizing to see the result of hundreds of hours of thought and research co-opted so easily, and perhaps that is inherent in a free marketplace, but we are not demoralized.  *We are motivated; to widen the gap.*\n\n----------------------------------------------------\n### :family: User Testimonials\n\n[![](https:\u002F\u002Fgithub.com\u002Fbrettwooldridge\u002FHikariCP\u002Fwiki\u002Ftweet3.png)](https:\u002F\u002Ftwitter.com\u002Fjkuipers)\u003Cbr\u002F>\n[![](https:\u002F\u002Fgithub.com\u002Fbrettwooldridge\u002FHikariCP\u002Fwiki\u002Ftweet1.png)](https:\u002F\u002Ftwitter.com\u002Fsteve_objectify)\u003Cbr\u002F>\n[![](https:\u002F\u002Fgithub.com\u002Fbrettwooldridge\u002FHikariCP\u002Fwiki\u002Ftweet2.png)](https:\u002F\u002Ftwitter.com\u002Fbrettemeyer)\u003Cbr\u002F>\n[![](https:\u002F\u002Fgithub.com\u002Fbrettwooldridge\u002FHikariCP\u002Fwiki\u002Ftweet4.png)](https:\u002F\u002Ftwitter.com\u002Fdgomesbr\u002Fstatus\u002F527521925401419776)\n\nIf you like this project, consider leaving a word for us on social media:\n\n[![](https:\u002F\u002Fraw.github.com\u002Fwiki\u002Fbrettwooldridge\u002FHikariCP\u002Ftwitter.png)](https:\u002F\u002Ftwitter.com\u002Fshare?text=Interesting%20JDBC%20Connection%20Pool&hashtags=HikariCP&url=https%3A%2F%2Fgithub.com%2Fbrettwooldridge%2FHikariCP)&nbsp;[![](https:\u002F\u002Fraw.github.com\u002Fwiki\u002Fbrettwooldridge\u002FHikariCP\u002Ffacebook.png)](http:\u002F\u002Fwww.facebook.com\u002Fplugins\u002Flike.php?href=https%3A%2F%2Fgithub.com%2Fbrettwooldridge%2FHikariCP&width&layout=standard&action=recommend&show_faces=true&share=false&height=80)\n------------------------------\n### :gear: Configuration (knobs, baby!)\nHikariCP comes with *sane* defaults that perform well in most deployments without additional tweaking. **Every property is optional, except for the \"essentials\" marked below.**\n\n\u003Csup>&#128206;\u003C\u002Fsup>&nbsp;*HikariCP uses milliseconds for all time values.*\n\n&#128680;&nbsp;HikariCP relies on accurate timers for both performance and reliability. It is *imperative* that your server is synchronized with a time-source such as an NTP server. *Especially* if your server is running within a virtual machine.  Why? [Read more here](https:\u002F\u002Fdba.stackexchange.com\u002Fa\u002F171020). **Do not rely on hypervisor settings to \"synchronize\" the clock of the virtual machine. Configure time-source synchronization inside the virtual machine.**   If you come asking for support on an issue that turns out to be caused by lack time synchronization, you will be taunted publicly on Twitter.\n\n#### Essentials\n\n&#128292;``dataSourceClassName``\u003Cbr\u002F>\nThis is the name of the ``DataSource`` class provided by the JDBC driver.  Consult the\ndocumentation for your specific JDBC driver to get this class name, or see the [table](https:\u002F\u002Fgithub.com\u002Fbrettwooldridge\u002FHikariCP#popular-datasource-class-names) below.\nNote XA data sources are not supported.  XA requires a real transaction manager like\n[bitronix](https:\u002F\u002Fgithub.com\u002Fbitronix\u002Fbtm). Note that you do not need this property if you are using\n``jdbcUrl`` for \"old-school\" DriverManager-based JDBC driver configuration.\n*Default: none*\n\n*- or -*\n\n&#128292;``jdbcUrl``\u003Cbr\u002F>\nThis property directs HikariCP to use \"DriverManager-based\" configuration.  We feel that DataSource-based\nconfiguration (above) is superior for a variety of reasons (see below), but for many deployments there is\nlittle significant difference.  **When using this property with \"old\" drivers, you may also need to set\nthe  ``driverClassName`` property, but try it first without.**  Note that if this property is used, you may\nstill use *DataSource* properties to configure your driver and is in fact recommended over driver parameters\nspecified in the URL itself.\n*Default: none*\n\n***\n\n&#128292;``username``\u003Cbr\u002F>\nThis property sets the default authentication username used when obtaining *Connections* from\nthe underlying driver.  Note that for DataSources this works in a very deterministic fashion by\ncalling ``DataSource.getConnection(*username*, password)`` on the underlying DataSource.  However,\nfor Driver-based configurations, every driver is different.  In the case of Driver-based, HikariCP\nwill use this ``username`` property to set a ``user`` property in the ``Properties`` passed to the\ndriver's ``DriverManager.getConnection(jdbcUrl, props)`` call.  If this is not what you need,\nskip this method entirely and call ``addDataSourceProperty(\"username\", ...)``, for example.\n*Default: none*\n\n&#128292;``password``\u003Cbr\u002F>\nThis property sets the default authentication password used when obtaining *Connections* from\nthe underlying driver. Note that for DataSources this works in a very deterministic fashion by\ncalling ``DataSource.getConnection(username, *password*)`` on the underlying DataSource.  However,\nfor Driver-based configurations, every driver is different.  In the case of Driver-based, HikariCP\nwill use this ``password`` property to set a ``password`` property in the ``Properties`` passed to the\ndriver's ``DriverManager.getConnection(jdbcUrl, props)`` call.  If this is not what you need,\nskip this method entirely and call ``addDataSourceProperty(\"pass\", ...)``, for example.\n*Default: none*\n\n#### Frequently used\n\n&#9989;``autoCommit``\u003Cbr\u002F>\nThis property controls the default auto-commit behavior of connections returned from the pool.\nIt is a boolean value.\n*Default: true*\n\n&#9203;``connectionTimeout``\u003Cbr\u002F>\nThis property controls the maximum number of milliseconds that a client (that's you) will wait\nfor a connection from the pool.  If this time is exceeded without a connection becoming\navailable, a SQLException will be thrown.  Lowest acceptable connection timeout is 250 ms.\n*Default: 30000 (30 seconds)*\n\n&#9203;``idleTimeout``\u003Cbr\u002F>\nThis property controls the maximum amount of time that a connection is allowed to sit idle in the\npool.  **This setting only applies when ``minimumIdle`` is defined to be less than ``maximumPoolSize``.**\nIdle connections will *not* be retired once the pool reaches ``minimumIdle`` connections.  Whether a\nconnection is retired as idle or not is subject to a maximum variation of +30 seconds, and average\nvariation of +15 seconds.  A connection will never be retired as idle *before* this timeout.  A value\nof 0 means that idle connections are never removed from the pool.  The minimum allowed value is 10000ms\n(10 seconds).\n*Default: 600000 (10 minutes)*\n\n&#9203;``keepaliveTime``\u003Cbr\u002F>\nThis property controls how frequently HikariCP will attempt to keep a connection alive, in order to prevent\nit from being timed out by the database or network infrastructure. This value must be less than the\n`maxLifetime` value. A \"keepalive\" will only occur on an idle connection. When the time arrives for a \"keepalive\"\nagainst a given connection, that connection will be removed from the pool, \"pinged\", and then returned to the\npool. The 'ping' is one of either: invocation of the JDBC4 `isValid()` method, or execution of the\n`connectionTestQuery`. Typically, the duration out-of-the-pool should be measured in single digit milliseconds\nor even sub-millisecond, and therefore should have little or no noticeable performance impact. The minimum\nallowed value is 30000ms (30 seconds), but a value in the range of minutes is most desirable.\n*Default: 120000 (2 minutes)*\n\n&#9203;``maxLifetime``\u003Cbr\u002F>\nThis property controls the maximum lifetime of a connection in the pool.  An in-use connection will\nnever be retired, only when it is closed will it then be removed.  On a connection-by-connection\nbasis, minor negative attenuation is applied to avoid mass-extinction in the pool.  **We strongly recommend\nsetting this value, and it should be several seconds shorter than any database or infrastructure imposed\nconnection time limit.**  A value of 0 indicates no maximum lifetime (infinite lifetime), subject of\ncourse to the ``idleTimeout`` setting.  The minimum allowed value is 30000ms (30 seconds).\n*Default: 1800000 (30 minutes)*\n\n&#128292;``connectionTestQuery``\u003Cbr\u002F>\n**If your driver supports JDBC4 we strongly recommend not setting this property.** This is for\n\"legacy\" drivers that do not support the JDBC4 ``Connection.isValid() API``.  This is the query that\nwill be executed just before a connection is given to you from the pool to validate that the\nconnection to the database is still alive. *Again, try running the pool without this property,\nHikariCP will log an error if your driver is not JDBC4 compliant to let you know.*\n*Default: none*\n\n&#128290;``minimumIdle``\u003Cbr\u002F>\nThis property controls the minimum number of *idle connections* that HikariCP tries to maintain\nin the pool.  If the idle connections dip below this value and total connections in the pool are less than ``maximumPoolSize``,\nHikariCP will make a best effort to add additional connections quickly and efficiently.\nHowever, for maximum performance and responsiveness to spike demands,\nwe recommend *not* setting this value and instead allowing HikariCP to act as a *fixed size* connection pool.\n*Default: same as maximumPoolSize*\n\n&#128290;``maximumPoolSize``\u003Cbr\u002F>\nThis property controls the maximum size that the pool is allowed to reach, including both\nidle and in-use connections.  Basically this value will determine the maximum number of\nactual connections to the database backend.  A reasonable value for this is best determined\nby your execution environment.  When the pool reaches this size, and no idle connections are\navailable, calls to getConnection() will block for up to ``connectionTimeout`` milliseconds\nbefore timing out.  Please read [about pool sizing](https:\u002F\u002Fgithub.com\u002Fbrettwooldridge\u002FHikariCP\u002Fwiki\u002FAbout-Pool-Sizing).\n*Default: 10*\n\n&#128200;``metricRegistry``\u003Cbr\u002F>\nThis property is only available via programmatic configuration or IoC container.  This property\nallows you to specify an instance of a *Codahale\u002FDropwizard* ``MetricRegistry`` to be used by the\npool to record various metrics.  See the [Metrics](https:\u002F\u002Fgithub.com\u002Fbrettwooldridge\u002FHikariCP\u002Fwiki\u002FDropwizard-Metrics)\nwiki page for details.\n*Default: none*\n\n&#128200;``healthCheckRegistry``\u003Cbr\u002F>\nThis property is only available via programmatic configuration or IoC container.  This property\nallows you to specify an instance of a *Codahale\u002FDropwizard* ``HealthCheckRegistry`` to be used by the\npool to report current health information.  See the [Health Checks](https:\u002F\u002Fgithub.com\u002Fbrettwooldridge\u002FHikariCP\u002Fwiki\u002FDropwizard-HealthChecks)\nwiki page for details.\n*Default: none*\n\n&#128292;``poolName``\u003Cbr\u002F>\nThis property represents a user-defined name for the connection pool and appears mainly\nin logging and JMX management consoles to identify pools and pool configurations.\n*Default: auto-generated*\n\n#### Infrequently used\n\n&#9203;``initializationFailTimeout``\u003Cbr\u002F>\nThis property controls whether the pool will \"fail fast\" if the pool cannot be seeded with\nan initial connection successfully.  Any positive number is taken to be the number of\nmilliseconds to attempt to acquire an initial connection; the application thread will be\nblocked during this period.  If a connection cannot be acquired before this timeout occurs,\nan exception will be thrown.  This timeout is applied *after* the ``connectionTimeout``\nperiod.  If the value is zero (0), HikariCP will attempt to obtain and validate a connection.\nIf a connection is obtained, but fails validation, an exception will be thrown and the pool\nnot started.  However, if a connection cannot be obtained, the pool will start, but later\nefforts to obtain a connection may fail.  A value less than zero will bypass any initial\nconnection attempt, and the pool will start immediately while trying to obtain connections\nin the background.  Consequently, later efforts to obtain a connection may fail.\n*Default: 1*\n\n&#10062;``isolateInternalQueries``\u003Cbr\u002F>\nThis property determines whether HikariCP isolates internal pool queries, such as the\nconnection alive test, in their own transaction.  Since these are typically read-only\nqueries, it is rarely necessary to encapsulate them in their own transaction.  This\nproperty only applies if ``autoCommit`` is disabled.\n*Default: false*\n\n&#10062;``allowPoolSuspension``\u003Cbr\u002F>\nThis property controls whether the pool can be suspended and resumed through JMX.  This is\nuseful for certain failover automation scenarios.  When the pool is suspended, calls to\n``getConnection()`` will *not* timeout and will be held until the pool is resumed.\n*Default: false*\n\n&#10062;``readOnly``\u003Cbr\u002F>\nThis property controls whether *Connections* obtained from the pool are in read-only mode by\ndefault.  Note some databases do not support the concept of read-only mode, while others provide\nquery optimizations when the *Connection* is set to read-only.  Whether you need this property\nor not will depend largely on your application and database.\n*Default: false*\n\n&#10062;``registerMbeans``\u003Cbr\u002F>\nThis property controls whether or not JMX Management Beans (\"MBeans\") are registered or not.\n*Default: false*\n\n&#128292;``catalog``\u003Cbr\u002F>\nThis property sets the default *catalog* for databases that support the concept of catalogs.\nIf this property is not specified, the default catalog defined by the JDBC driver is used.\n*Default: driver default*\n\n&#128292;``connectionInitSql``\u003Cbr\u002F>\nThis property sets a SQL statement that will be executed after every new connection creation\nbefore adding it to the pool. If this SQL is not valid or throws an exception, it will be\ntreated as a connection failure and the standard retry logic will be followed.\n*Default: none*\n\n&#128292;``driverClassName``\u003Cbr\u002F>\nHikariCP will attempt to resolve a driver through the DriverManager based solely on the ``jdbcUrl``,\nbut for some older drivers the ``driverClassName`` must also be specified.  Omit this property unless\nyou get an obvious error message indicating that the driver was not found.\n*Default: none*\n\n&#128292;``transactionIsolation``\u003Cbr\u002F>\nThis property controls the default transaction isolation level of connections returned from\nthe pool.  If this property is not specified, the default transaction isolation level defined\nby the JDBC driver is used.  Only use this property if you have specific isolation requirements that are\ncommon for all queries.  The value of this property is the constant name from the ``Connection``\nclass such as ``TRANSACTION_READ_COMMITTED``, ``TRANSACTION_REPEATABLE_READ``, etc.\n*Default: driver default*\n\n&#9203;``validationTimeout``\u003Cbr\u002F>\nThis property controls the maximum amount of time that a connection will be tested for aliveness.\nThis value must be less than the ``connectionTimeout``.  Lowest acceptable validation timeout is 250 ms.\n*Default: 5000*\n\n&#9203;``leakDetectionThreshold``\u003Cbr\u002F>\nThis property controls the amount of time that a connection can be out of the pool before a\nmessage is logged indicating a possible connection leak.  A value of 0 means leak detection\nis disabled.  Lowest acceptable value for enabling leak detection is 2000 (2 seconds).\n*Default: 0*\n\n&#10145;``dataSource``\u003Cbr\u002F>\nThis property is only available via programmatic configuration or IoC container. This property\nallows you to directly set the instance of the ``DataSource`` to be wrapped by the pool, rather than\nhaving HikariCP construct it via reflection.  This can be useful in some dependency injection\nframeworks. When this property is specified, the ``dataSourceClassName`` property and all\nDataSource-specific properties will be ignored.\n*Default: none*\n\n&#128292;``schema``\u003Cbr\u002F>\nThis property sets the default *schema* for databases that support the concept of schemas.\nIf this property is not specified, the default schema defined by the JDBC driver is used.\n*Default: driver default*\n\n&#10145;``threadFactory``\u003Cbr\u002F>\nThis property is only available via programmatic configuration or IoC container. This property\nallows you to set the instance of the ``java.util.concurrent.ThreadFactory`` that will be used\nfor creating all threads used by the pool. It is needed in some restricted execution environments\nwhere threads can only be created through a ``ThreadFactory`` provided by the application container.\n*Default: none*\n\n&#10145;``scheduledExecutor``\u003Cbr\u002F>\nThis property is only available via programmatic configuration or IoC container. This property\nallows you to set the instance of the ``java.util.concurrent.ScheduledExecutorService`` that will\nbe used for various internally scheduled tasks.  If supplying HikariCP with a ``ScheduledThreadPoolExecutor``\ninstance, it is recommended that ``setRemoveOnCancelPolicy(true)`` is used.\n*Default: none*\n\n&#10145;``exceptionOverride``\u003Cbr\u002F>\nThis property is only available via programmatic configuration or IoC container. This property\nallows you to set an instance of a class, implementing the ``com.zaxxer.hikari.SQLExceptionOverride``\ninterface, that will be called before a connection is evicted from the pool due to specific exception\nconditions. Typically, when a ``SQLException`` is thrown, connections are evicted from the pool when\nspecific *SQLStates* or *ErrorCodes* are present. The ``adjudicate()`` method will be called on the\n``SQLExceptionOverride`` instance, which may return one of: ``Override.CONTINUE_EVICT``.\n``Override.DO_NOT_EVICT`` or ``Override.MUST_EVICT``. Except in very specific cases\n``Override.CONTINUE_EVICT`` should be returned, allowing the default evict\u002Fno-evict logic to execute.\n*Default: none*\n\n&#128292;``exceptionOverrideClassName``\u003Cbr\u002F>\nThis property allows you to specify the name of a user-supplied class implementing the\n``com.zaxxer.hikari.SQLExceptionOverride`` interface. An instance of the class will be instantiated\nby the pool to adjudicate connection evictions. See the above property ``exceptionOverride`` for a\nfull description.\n*Default: none*\n\n----------------------------------------------------\n\n#### Missing Knobs\n\nHikariCP has plenty of \"knobs\" to turn as you can see above, but comparatively less than some other pools.\nThis is a design philosophy.  The HikariCP design aesthetic is Minimalism.  In keeping with the\n*simple is better* or *less is more* design philosophy, some configuration axis are intentionally left out.\n\n#### Statement Cache\n\nMany connection pools, including Apache DBCP, Vibur, c3p0 and others offer ``PreparedStatement`` caching.\nHikariCP does not.  Why?\n\nAt the connection pool layer ``PreparedStatements`` can only be cached *per connection*.  If your application\nhas 250 commonly executed queries and a pool of 20 connections you are asking your database to hold on to\n5000 query execution plans -- and similarly the pool must cache this many ``PreparedStatements`` and their\nrelated graph of objects.\n\nMost major database JDBC drivers already have a Statement cache that can be configured, including PostgreSQL,\nOracle, Derby, MySQL, DB2, and many others.  JDBC drivers are in a unique position to exploit database specific\nfeatures, and nearly all of the caching implementations are capable of sharing execution plans *across connections*.\nThis means that instead of 5000 statements in memory and associated execution plans, your 250 commonly executed\nqueries result in exactly 250 execution plans in the database.  Clever implementations do not even retain\n``PreparedStatement`` objects in memory at the driver-level but instead merely attach new instances to existing plan IDs.\n\nUsing a statement cache at the pooling layer is an [anti-pattern](https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FAnti-pattern),\nand will negatively impact your application performance compared to driver-provided caches.\n\n#### Log Statement Text \u002F Slow Query Logging\n\nLike Statement caching, most major database vendors support statement logging through\nproperties of their own driver.  This includes Oracle, MySQL, Derby, MSSQL, and others.  Some\neven support slow query logging.  For those few databases that do not support it, several options are available.\nWe have received [a report that p6spy works well](https:\u002F\u002Fgithub.com\u002Fbrettwooldridge\u002FHikariCP\u002Fissues\u002F57#issuecomment-354647631),\nand also note the availability of [log4jdbc](https:\u002F\u002Fgithub.com\u002Farthurblake\u002Flog4jdbc) and [jdbcdslog-exp](https:\u002F\u002Fcode.google.com\u002Fp\u002Fjdbcdslog-exp\u002F).\n\n#### Rapid Recovery\nPlease read the [Rapid Recovery Guide](https:\u002F\u002Fgithub.com\u002Fbrettwooldridge\u002FHikariCP\u002Fwiki\u002FRapid-Recovery) for details on how to configure your driver and system for proper recovery from database restart and network partition events.\n\n----------------------------------------------------\n\n### :see_no_evil: Secret Properties\n\nHikariCP has several Java system properties that control various aspects of the pool. These properties are *unsupported*\nfor user manipulation. It is possible though unlikely that they may not exist in the future. This means: do not open an issue of any kind if you have modified these properties. *Pretend you never heard anything about \"secret properties\".*\n\n| Property                                      | Description                                                                                                                                                                                                                                       |\n|:----------------------------------------------|:--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ``com.zaxxer.hikari.blockUntilFilled``        | When this property is set ``true`` *and* ``initializationFailTimeout`` is greater than 1, the pool will block during start until completely filled.                                                                                               |\n| ``com.zaxxer.hikari.enableRequestBoundaries`` | When this property is set ``true``, HikariCP will bracket connection acquisition and return with calls to ``Connection.beginRequest()`` and ``Connection.endRequest()``.                                                                          |\n| ``com.zaxxer.hikari.housekeeping.period``     | This property controls the frequency of the housekeeping thread, represented in milliseconds. Really, don't mess with this.                                                                                                                       |\n| ``com.zaxxer.hikari.legacy.supportUserPassDataSourceOverride`` | When this property is set ``true``, HikariCP will support the legacy behavior of overriding the ``getUsername()\u002FgetPassword()`` methods on *HikariDataSource*. Preferred method is overriding ``getCredentials()``.             |\n| ``com.zaxxer.hikari.useWeakReferences``       | When this property is set ``true`` it will force HikariCP to use ``WeakReference`` objects in the ``ConcurrentBag`` internal collection ThreadLocals and prevent the use of our ``FastList`` class, all to avoid TomCat warnings during redeploy. |\n\nEither don't use these properties or take on full responsibility for the consequences.\n\n### :rocket: Initialization\n\nYou can use the ``HikariConfig`` class like so\u003Csup>1\u003C\u002Fsup>:\n```java\nHikariConfig config = new HikariConfig();\nconfig.setJdbcUrl(\"jdbc:mysql:\u002F\u002Flocalhost:3306\u002Fsimpsons\");\nconfig.setUsername(\"bart\");\nconfig.setPassword(\"51mp50n\");\nconfig.addDataSourceProperty(\"cachePrepStmts\", \"true\");\nconfig.addDataSourceProperty(\"prepStmtCacheSize\", \"250\");\nconfig.addDataSourceProperty(\"prepStmtCacheSqlLimit\", \"2048\");\n\nHikariDataSource ds = new HikariDataSource(config);\n```\n&nbsp;\u003Csup>\u003Csup>1\u003C\u002Fsup> MySQL-specific example, DO NOT COPY VERBATIM.\u003C\u002Fsup>\n\nor directly instantiate a ``HikariDataSource`` like so:\n```java\nHikariDataSource ds = new HikariDataSource();\nds.setJdbcUrl(\"jdbc:mysql:\u002F\u002Flocalhost:3306\u002Fsimpsons\");\nds.setUsername(\"bart\");\nds.setPassword(\"51mp50n\");\n...\n```\nor property file based:\n```java\n\u002F\u002F Examines both filesystem and classpath for .properties file\nHikariConfig config = new HikariConfig(\"\u002Fsome\u002Fpath\u002Fhikari.properties\");\nHikariDataSource ds = new HikariDataSource(config);\n```\nExample property file:\n```ini\ndataSourceClassName=org.postgresql.ds.PGSimpleDataSource\ndataSource.user=test\ndataSource.password=test\ndataSource.databaseName=mydb\ndataSource.portNumber=5432\ndataSource.serverName=localhost\n```\nor ``java.util.Properties`` based:\n```java\nProperties props = new Properties();\nprops.setProperty(\"dataSourceClassName\", \"org.postgresql.ds.PGSimpleDataSource\");\nprops.setProperty(\"dataSource.user\", \"test\");\nprops.setProperty(\"dataSource.password\", \"test\");\nprops.setProperty(\"dataSource.databaseName\", \"mydb\");\nprops.put(\"dataSource.logWriter\", new PrintWriter(System.out));\n\nHikariConfig config = new HikariConfig(props);\nHikariDataSource ds = new HikariDataSource(config);\n```\n\nThere is also a System property available, ``hikaricp.configurationFile``, that can be used to specify the\nlocation of a properties file.  If you intend to use this option, construct a ``HikariConfig`` or ``HikariDataSource``\ninstance using the default constructor and the properties file will be loaded.\n\n### Performance Tips\n[MySQL Performance Tips](https:\u002F\u002Fgithub.com\u002Fbrettwooldridge\u002FHikariCP\u002Fwiki\u002FMySQL-Configuration)\n\n### Popular DataSource Class Names\n\nWe recommended using ``dataSourceClassName`` instead of ``jdbcUrl``, but either is acceptable.  We'll say that again, *either is acceptable*.\n\n&#9888;&nbsp;*Note: Spring Boot auto-configuration users, you need to use ``jdbcUrl``-based configuration.*\n\n&#9888;&nbsp;The MySQL DataSource is known to be broken with respect to network timeout support. Use ``jdbcUrl`` configuration instead.\n\nHere is a list of JDBC *DataSource* classes for popular databases:\n\n| Database         | Driver       | *DataSource* class |\n|:---------------- |:------------ |:-------------------|\n| Apache Derby     | Derby        | org.apache.derby.jdbc.ClientDataSource |\n| Firebird         | Jaybird      | org.firebirdsql.ds.FBSimpleDataSource |\n| Google Spanner   | Spanner      | com.google.cloud.spanner.jdbc.JdbcDriver |\n| H2               | H2           | org.h2.jdbcx.JdbcDataSource |\n| HSQLDB           | HSQLDB       | org.hsqldb.jdbc.JDBCDataSource |\n| IBM DB2          | IBM JCC      | com.ibm.db2.jcc.DB2SimpleDataSource |\n| IBM Informix     | IBM Informix | com.informix.jdbcx.IfxDataSource |\n| MS SQL Server    | Microsoft    | com.microsoft.sqlserver.jdbc.SQLServerDataSource |\n| ~~MySQL~~        | Connector\u002FJ  | ~~com.mysql.jdbc.jdbc2.optional.MysqlDataSource~~ |\n| MariaDB          | MariaDB      | org.mariadb.jdbc.MariaDbDataSource |\n| Oracle           | Oracle       | oracle.jdbc.pool.OracleDataSource |\n| OrientDB         | OrientDB     | com.orientechnologies.orient.jdbc.OrientDataSource |\n| PostgreSQL       | pgjdbc-ng    | com.impossibl.postgres.jdbc.PGDataSource |\n| PostgreSQL       | PostgreSQL   | org.postgresql.ds.PGSimpleDataSource |\n| SAP MaxDB        | SAP          | com.sap.dbtech.jdbc.DriverSapDB |\n| SQLite           | xerial       | org.sqlite.SQLiteDataSource |\n| SyBase           | jConnect     | com.sybase.jdbc4.jdbc.SybDataSource |\n\n### Play Framework Plugin\n\nNote Play 2.4 now uses HikariCP by default.  A new plugin has come up for the the Play framework; [play-hikaricp](http:\u002F\u002Fedulify.github.io\u002Fplay-hikaricp.edulify.com\u002F).  If you're using the excellent Play framework,  your application deserves HikariCP.  Thanks Edulify Team!\n\n### Clojure Wrapper\n\nA new Clojure wrapper has been created by [tomekw](https:\u002F\u002Fgithub.com\u002Ftomekw) and can be [found here](https:\u002F\u002Fgithub.com\u002Ftomekw\u002Fhikari-cp).\n\n### JRuby Wrapper\n\nA new JRuby wrapper has been created by [tomekw](https:\u002F\u002Fgithub.com\u002Ftomekw) and can be [found here](https:\u002F\u002Fgithub.com\u002Ftomekw\u002Fhucpa).\n\n----------------------------------------------------\n\n### Wiki\n\nDon't forget the [Wiki](https:\u002F\u002Fgithub.com\u002Fbrettwooldridge\u002FHikariCP\u002Fwiki) for additional information such as:\n * [FAQ](https:\u002F\u002Fgithub.com\u002Fbrettwooldridge\u002FHikariCP\u002Fwiki\u002FFAQ)\n * [Hibernate 4.x Configuration](https:\u002F\u002Fgithub.com\u002Fbrettwooldridge\u002FHikariCP\u002Fwiki\u002FHibernate4)\n * [MySQL Configuration Tips](https:\u002F\u002Fgithub.com\u002Fbrettwooldridge\u002FHikariCP\u002Fwiki\u002FMySQL-Configuration)\n * etc.\n\n----------------------------------------------------\n\n### Requirements\n\n &#8658; Java 11+ (Java 6\u002F7\u002F8 artifacts are in maintenance mode)\u003Cbr\u002F>\n &#8658; slf4j library\u003Cbr\u002F>\n\n### Sponsors\nHigh-performance projects can never have too many tools!  We would like to thank the following companies:\n\nThanks to [ej-technologies](https:\u002F\u002Fwww.ej-technologies.com) for their excellent all-in-one profiler, [JProfiler](https:\u002F\u002Fwww.ej-technologies.com\u002Fproducts\u002Fjprofiler\u002Foverview.html).\n\nYourKit supports open source projects with its full-featured Java Profiler.  Click the YourKit logo below to learn more.\u003Cbr\u002F>\n[![](https:\u002F\u002Fgithub.com\u002Fbrettwooldridge\u002FHikariCP\u002Fwiki\u002Fyklogo.png)](http:\u002F\u002Fwww.yourkit.com\u002Fjava\u002Fprofiler\u002Findex.jsp)\u003Cbr\u002F>\n\n\n### Contributions\n\nPlease perform changes and submit pull requests from the ``dev`` branch instead of ``master``.  Please set your editor to use spaces instead of tabs, and adhere to the apparent style of the code you are editing.  The ``dev`` branch is always more \"current\" than the ``master`` if you are looking to live life on the edge.\n\n[Build Status]:https:\u002F\u002Fcircleci.com\u002Fgh\u002Fbrettwooldridge\u002FHikariCP\n[Build Status img]:https:\u002F\u002Fcircleci.com\u002Fgh\u002Fbrettwooldridge\u002FHikariCP\u002Ftree\u002Fdev.svg?style=shield\n\n[Coverage Status]:https:\u002F\u002Fcodecov.io\u002Fgh\u002Fbrettwooldridge\u002FHikariCP\n[Coverage Status img]:https:\u002F\u002Fcodecov.io\u002Fgh\u002Fbrettwooldridge\u002FHikariCP\u002Fbranch\u002Fdev\u002Fgraph\u002Fbadge.svg\n\n[license]:LICENSE\n[license img]:https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Flicense-Apache%202-blue.svg\n\n[Javadocs]:http:\u002F\u002Fjavadoc.io\u002Fdoc\u002Fcom.zaxxer\u002FHikariCP\n[Javadocs img]:http:\u002F\u002Fjavadoc.io\u002Fbadge\u002Fcom.zaxxer\u002FHikariCP.svg\n\n[Librapay]:https:\u002F\u002Fliberapay.com\u002Fbrettwooldridge\n[Librapay img]:https:\u002F\u002Fimg.shields.io\u002Fliberapay\u002Fpatrons\u002Fbrettwooldridge.svg?logo=liberapay\n","HikariCP 是一个高性能的JDBC连接池，专为生产环境设计。其核心功能包括零开销、高可靠性和简单配置，通过优化内部实现机制，确保了极低的内存占用（约165Kb）和出色的性能表现。该项目支持Java 11及以上版本，并且提供了详细的配置选项来满足不同应用场景的需求。适用于需要高效数据库连接管理的企业级应用开发场景，特别是在对响应速度和资源利用率有严格要求的情况下，如金融交易系统或大型电子商务平台等。","2026-06-11 02:57:24","top_language"]