ibm-information-center/dist/eclipse/plugins/i5OS.ic.rzaha_5.4.0.1/poolstat.htm

78 lines
5.7 KiB
HTML
Raw Normal View History

2024-04-02 14:02:31 +00:00
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en-us" xml:lang="en-us">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="security" content="public" />
<meta name="Robots" content="index,follow" />
<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
<meta name="DC.Type" content="concept" />
<meta name="DC.Title" content="DataSource-based statement pooling" />
<meta name="abstract" content="The maxStatements property, available on the UDBConnectionPoolDataSource interface, allows for statement pooling within the connection pool. Statement pooling only has an effect on PreparedStatements and CallableStatements. Statement objects are not pooled." />
<meta name="description" content="The maxStatements property, available on the UDBConnectionPoolDataSource interface, allows for statement pooling within the connection pool. Statement pooling only has an effect on PreparedStatements and CallableStatements. Statement objects are not pooled." />
<meta name="DC.Relation" scheme="URI" content="jdbcpool.htm" />
<meta name="DC.Relation" scheme="URI" content="poolwdts.htm" />
<meta name="DC.Relation" scheme="URI" content="poolprop.htm" />
<meta name="DC.Relation" scheme="URI" content="poolnods.htm" />
<meta name="DC.Relation" scheme="URI" content="statementpoolingtest.htm" />
<meta name="copyright" content="(C) Copyright IBM Corporation 2006" />
<meta name="DC.Rights.Owner" content="(C) Copyright IBM Corporation 2006" />
<meta name="DC.Format" content="XHTML" />
<meta name="DC.Identifier" content="poolstat" />
<meta name="DC.Language" content="en-us" />
<!-- All rights reserved. Licensed Materials Property of IBM -->
<!-- US Government Users Restricted Rights -->
<!-- Use, duplication or disclosure restricted by -->
<!-- GSA ADP Schedule Contract with IBM Corp. -->
<link rel="stylesheet" type="text/css" href="./ibmdita.css" />
<link rel="stylesheet" type="text/css" href="./ic.css" />
<title>DataSource-based statement pooling</title>
</head>
<body id="poolstat"><a name="poolstat"><!-- --></a>
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
<h1 class="topictitle1">DataSource-based statement pooling</h1>
<div><p>The maxStatements property, available on the UDBConnectionPoolDataSource
interface, allows for statement pooling within the connection pool. Statement
pooling only has an effect on PreparedStatements and CallableStatements. Statement
objects are not pooled.</p>
<p>The implementation of statement pooling is similar to that of connection
pooling. When the application calls Connection.prepareStatement("select *
from tablex"), the pooling module checks if the Statement object has already
been prepared under the connection. If it has, a logical PreparedStatement
object is handed to you instead of the physical object. When you call close,
the Connection object is returned to the pool, the logical Connection object
is thrown away, and the Statement object can be reused.</p>
<p>The maxStatements property allows the DataSource to specify how many statements
can be pooled under a connection. A value of 0 indicates that statement pooling
should not be used. When the statement pool is full, a least recently used
algorithm is applied to determine which statement is to be thrown out.</p>
<p><a href="statementpoolingtest.htm">Example: Test the performance of
two DataSources</a> tests one DataSource that uses connection pooling only
and the other DataSource that uses statement and connection pooling.</p>
<p>The following example is output from running this program locally during
development.</p>
<p>Deploying statement pooling data source Start timing the connection pooling
only version... Time spent: 26312</p>
<p>Starting timing the statement pooling version... Time spent: 2292 Java™ program
completed </p>
</div>
<div>
<ul class="ullinks">
<li class="ulchildlink"><strong><a href="statementpoolingtest.htm">Example: Test the performance of two DataSources</a></strong><br />
This is an example of testing one DataSource that uses connection pooling only and the other DataSource that uses statement and connection pooling.</li>
</ul>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="jdbcpool.htm" title="Object pooling is the most common topic to come up when discussing Java Database Connectivity (JDBC) and performance. Since many objects used in JDBC are expensive to create such as Connection, Statement, and ResultSet objects, significant performance benefits can be achieved by reusing these objects instead of creating every time you need them.">JDBC object pooling</a></div>
</div>
<div class="relconcepts"><strong>Related concepts</strong><br />
<div><a href="poolwdts.htm" title="You can use DataSources to have multiple applications share a common configuration for accessing a database. This is accomplished by having each application reference the same DataSource name.">Use DataSource support for object pooling</a></div>
<div><a href="poolnods.htm" title="You can develop your own connection and statement pooling without requiring support for DataSources or relying on another product.">Build your own connection pooling</a></div>
</div>
<div class="relref"><strong>Related reference</strong><br />
<div><a href="poolprop.htm" title="You can configure the ConnectionPoolDataSource interface by using the set of properties that it provides.">ConnectionPoolDataSource properties</a></div>
</div>
</div>
</body>
</html>