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

372 lines
23 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="reference" />
<meta name="DC.Title" content="Connection properties" />
<meta name="abstract" content="This table contains valid JDBC driver connection properties, their values, and their descriptions." />
<meta name="description" content="This table contains valid JDBC driver connection properties, their values, and their descriptions." />
<meta name="DC.Relation" scheme="URI" content="connects.htm" />
<meta name="DC.Relation" scheme="URI" content="db2drivr.htm" />
<meta name="DC.Relation" scheme="URI" content="udbdatsr.htm" />
<meta name="DC.Relation" scheme="URI" content="dasrprop.htm" />
<meta name="DC.Relation" scheme="URI" content="otherdts.htm" />
<meta name="DC.Relation" scheme="URI" content="udbdatasourcebind.htm" />
<meta name="DC.Relation" scheme="URI" content="udbdatasourcebind2.htm" />
<meta name="DC.Relation" scheme="URI" content="udbdatasourceuse.htm" />
<meta name="DC.Relation" scheme="URI" content="udbdatasourceuse2.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="conprop" />
<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>Connection properties</title>
</head>
<body id="conprop"><a name="conprop"><!-- --></a>
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
<h1 class="topictitle1">Connection properties</h1>
<div><p>This table contains valid JDBC driver connection properties, their
values, and their descriptions.</p>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" width="100%" frame="border" border="1" rules="all"><thead align="left"><tr><th valign="top" id="d0e19">Property</th>
<th valign="top" id="d0e21">Values</th>
<th valign="top" id="d0e23">Meaning</th>
</tr>
</thead>
<tbody><tr><td valign="top" headers="d0e19 ">access</td>
<td valign="top" headers="d0e21 ">all, read call, read only</td>
<td valign="top" headers="d0e23 ">This value can be used to restrict the type of operations that can
be done with a specific connection. The default value is all and basically
means that the connection has full access to the JDBC API. The read call value
allows the connection to do only queries and call stored procedures. An attempt
to update the database through an SQL statement is stopped. The read only
value can be used to restrict a connection to only queries. Stored procedure
calls and update statements are stopped.</td>
</tr>
<tr><td valign="top" headers="d0e19 ">auto commit</td>
<td valign="top" headers="d0e21 ">true, false</td>
<td valign="top" headers="d0e23 ">This value is used to set the auto commit setting of the connection.
The default value is true unless the transaction isolation property has been
set to a value other than none. In that case, the default value is false.</td>
</tr>
<tr><td valign="top" headers="d0e19 ">batch style</td>
<td valign="top" headers="d0e21 ">2.0, 2.1</td>
<td valign="top" headers="d0e23 ">The JDBC 2.1 specification defines a second method for how exceptions
in a batch update can be handled. The driver can comply with either of these.
The default is to work as defined in the JDBC 2.0 specification.</td>
</tr>
<tr><td valign="top" headers="d0e19 ">block size</td>
<td valign="top" headers="d0e21 ">0, 8, 16, 32, 64, 128, 256, 512</td>
<td valign="top" headers="d0e23 ">This is the number of rows that are fetched at a time for a result
set. For typical forward-only processing of a result set, a block of this
size is obtained. Then the database is not accessed because each row is processed
by your application. The database requests another block of data only when
the end of the block is reached. <p>This value is only used if the blocking
enabled property is set to true.</p>
<p>Setting the block size property to
0 has the same effect as setting the blocking enabled property to false.</p>
<p>The
default is to use blocking with a block size of 32. This is a fairly
arbitrary decision and the default could change in the future.</p>
<p>Blocking is not used on scrollable result sets.</p>
</td>
</tr>
<tr><td valign="top" headers="d0e19 ">blocking enabled</td>
<td valign="top" headers="d0e21 ">true, false</td>
<td valign="top" headers="d0e23 ">This value is used to determine whether or not the connection uses
blocking on result set row retrieval. Blocking can significantly improve the
performance of processing result sets. <p>By default, this property is set
to true.</p>
</td>
</tr>
<tr><td valign="top" headers="d0e19 ">cursor hold</td>
<td valign="top" headers="d0e21 ">true, false</td>
<td valign="top" headers="d0e23 ">This value specifies whether or not result sets remain open when a
transaction is committed. A value of true means that an application is able
to access its open result sets after commit is called. A value of false means
that commit closes any open cursors under the connection.
<p>By default, this property is set
to true.</p>
<p>This
value property serves as a default value for all result sets made for the
connection. With cursor holdability support added in JDBC 3.0, this default
is simply replaced if an application specifies a different holdability later.</p>
<p>If
you are migrating to JDBC 3.0 from an earlier version, be aware that cursor
holdability support was not added until JDBC 3.0. In earlier versions, the
default value of "true" was sent at connect time, but it was not yet recognized
by the JVM. Therefore, the cursor hold property will not impact database functionality
until JDBC 3.0.</p>
</td>
</tr>
<tr><td valign="top" headers="d0e19 ">data truncation</td>
<td valign="top" headers="d0e21 ">true, false</td>
<td valign="top" headers="d0e23 ">This value specifies whether truncation of character data should cause
warnings and exceptions to be generated (true) or if the data should just
be silently truncated (false). If the default is true, data truncation of
character fields are honored. </td>
</tr>
<tr><td valign="top" headers="d0e19 ">date format</td>
<td valign="top" headers="d0e21 ">julian, mdy, dmy, ymd, usa, iso, eur, jis</td>
<td valign="top" headers="d0e23 ">This property allows you to change how dates are formatted. </td>
</tr>
<tr><td valign="top" headers="d0e19 ">date separator</td>
<td valign="top" headers="d0e21 ">/(slash), -(dash), .(period), ,(comma), b</td>
<td valign="top" headers="d0e23 ">This property allows you to change what the date separator is. This
is only valid in combination with some of the dateFormat values (according
to system rules). </td>
</tr>
<tr><td valign="top" headers="d0e19 ">decimal separator</td>
<td valign="top" headers="d0e21 ">.(period), ,(comma)</td>
<td valign="top" headers="d0e23 ">This property allows you to change what the decimal separator is. </td>
</tr>
<tr><td valign="top" headers="d0e19 ">do escape processing</td>
<td valign="top" headers="d0e21 ">true, false</td>
<td valign="top" headers="d0e23 ">This property sets a flag for whether or not statements under the connection
must do escape processing. Using escape processing is a way to code your SQL
statements so that they are generic and similar for all platforms, but then
the database reads the escape clauses and substitutes the proper system specific
version for the user. <p>This is good, except that it forces extra work
on the system. In the case where you know you are only using SQL statements
that already contain valid iSeries™ SQL syntax, it is recommended that this value
be set to false to increase performance.</p>
<p>The default value for this
property is true, as it must be compliant with the JDBC specification (that
is, escape processing is active by default).</p>
<p>This value is added due
to a shortcoming of the JDBC specification. You can only set escape processing
to off in the Statement class. That works well if you are dealing with simple
statements. You create your statement, turn off escape processing, and start
processing statements. However, in the case of prepared statements and callable
statements, this scheme does not work. You supply the SQL statement at the
time that the prepared or callable statement is constructed and it does not
change after that. So the statement is prepared up front and changing the
escape processing after that is meaningless. Having this connection property
allows a way to get around the extra overhead.</p>
</td>
</tr>
<tr><td valign="top" headers="d0e19 ">errors</td>
<td valign="top" headers="d0e21 ">basic, full</td>
<td valign="top" headers="d0e23 ">This property allows the full system second-level error text to be
returned in SQLException object messages. The default is basic which returns
only the standard message text. </td>
</tr>
<tr><td valign="top" headers="d0e19 ">libraries</td>
<td valign="top" headers="d0e21 ">A space-separated list of libraries. (A list of libraries can also
be separated by colons or commas.)</td>
<td valign="top" headers="d0e23 ">This property allows a list of libraries to be placed into the server
job's library list or a specific default library to be set. <p>The naming
property affects how this property works. In the default case, where naming
is set to sql, JDBC works like ODBC. The library list has no effect on how
the connection processes. There is a default library for all unqualified tables.
By default, that library has the same name as the user profile that is connected.
If the libraries property is specified, the first library in the list becomes
the default library. If a default library is specified on the connection URL
(as in jdbc:db2:*local/mylibrary), that overrides any value in this property.</p>
<p>In
the case where naming is set system, each of the libraries specified for this
property is added to the user portion of the library list and the library
list is searched to resolve unqualified table references.</p>
</td>
</tr>
<tr><td valign="top" headers="d0e19 ">lob threshold</td>
<td valign="top" headers="d0e21 ">Any value under 500000</td>
<td valign="top" headers="d0e23 ">This property tells the driver to place the actual values into the
result set storage instead of locators for lob columns if the lob column is
smaller than the threshold size. This property acts against the column size,
not the lob data size itself. For example, if the lob column is defined to
hold up to 1 MB for each lob, but all the column values are under 500 KB,
locators are still used. <p>Note that the size limit is set as it is to allow
blocks of data to be fetched without danger of not always growing data blocks
larger than the 16 MB maximum allocation size. With large result sets, it
is still easy to exceed this limit, which causes fetches to fail. Care must
be taken in how the block size property and this property interact with the
size of a data block.</p>
<p>The default is 0. Locators are always used for
lob data.</p>
</td>
</tr>
<tr><td valign="top" headers="d0e19 ">maximum precision</td>
<td valign="top" headers="d0e21 ">31, 63</td>
<td valign="top" headers="d0e23 ">This value specifies the maximum precision (length) that is returned
for result data types. The default value is 31. </td>
</tr>
<tr><td valign="top" headers="d0e19 ">maximum scale</td>
<td valign="top" headers="d0e21 ">0-63</td>
<td valign="top" headers="d0e23 ">This value specifies the maximum scale (number of decimal positions
to the right of the decimal point) that is returned for result data types.
The value can range from 0 to the maximum precision. The default value is
31.</td>
</tr>
<tr><td valign="top" headers="d0e19 ">minimum divide scale</td>
<td valign="top" headers="d0e21 ">0-9</td>
<td valign="top" headers="d0e23 ">This value specifies the minimum divide scale (number of decimal positions
to the right of the decimal point) that is returned for both intermediary
and result data types. The value can range from 0 to 9, not to exceed the
maximum scale. If 0 is specified, minimum divide scale is not used. The default
value is 0.</td>
</tr>
<tr><td valign="top" headers="d0e19 ">naming</td>
<td valign="top" headers="d0e21 ">sql, system</td>
<td valign="top" headers="d0e23 ">This property allows you to use either the traditional iSeries naming
syntax or the standard SQL naming syntax. System naming means that you use
a /(slash) character to separate collection and table values, and SQL naming
means that you use a .(period) character to separate the values. <p>The
setting of this value has ramifications for what the default library is also.
See the libraries property above for further information on this.</p>
<p>The
default is to use SQL naming.</p>
</td>
</tr>
<tr><td valign="top" headers="d0e19 ">password</td>
<td valign="top" headers="d0e21 ">anything</td>
<td valign="top" headers="d0e23 ">This property allows for a password to be specified for the connection.
This property does not work correctly without also specifying the user property.
These properties allow for connections to be made to the database as a user
other than the one that is running the iSeries job. <p>Specifying the user
and password properties have the same effect as using the connection method
with the signature getConnection(String url, String userId, String password).</p>
</td>
</tr>
<tr><td valign="top" headers="d0e19 ">prefetch</td>
<td valign="top" headers="d0e21 ">true, false </td>
<td valign="top" headers="d0e23 ">This property specifies whether or not the driver fetches the first
data for a result set immediately after processing or wait until the data
is requested. If the default is true, data is prefetched.
<p>For applications using the Native JDBC driver,
this is rarely an issue. The property exists primarily for internal use with Java™ stored
procedures and user-defined functions where it is important that the database
engine does not fetch any data from result sets on your behalf before you
request it.</p>
</td>
</tr>
<tr><td valign="top" headers="d0e19 ">reuse objects</td>
<td valign="top" headers="d0e21 ">true, false</td>
<td valign="top" headers="d0e23 ">This property specifies whether or not the driver attempts to reuse
some types of objects after you close them. This is a performance enhancement.
The default is true. </td>
</tr>
<tr><td valign="top" headers="d0e19 ">server trace</td>
<td valign="top" headers="d0e21 ">A string representation of an integer</td>
<td valign="top" headers="d0e23 ">This property enables tracing of the JDBC server job. If server tracing
is enabled, tracing starts when the client connects to the server, and ends
when the connection is disconnected.
<p>Trace data is collected in spooled files on the server.
Multiple levels of server tracing can be turned on in combination by adding
the constants and passing that sum on the set method.</p>
<div class="note"><span class="notetitle">Note:</span> This property is typically used
by support personnel and its values are not discussed further.</div>
</td>
</tr>
<tr><td valign="top" headers="d0e19 ">time format</td>
<td valign="top" headers="d0e21 ">hms, usa, iso, eur, jis</td>
<td valign="top" headers="d0e23 ">This property allows you to change how time values are formatted. </td>
</tr>
<tr><td valign="top" headers="d0e19 ">time separator</td>
<td valign="top" headers="d0e21 ">:(colon), .(period), ,(comma), b</td>
<td valign="top" headers="d0e23 ">This property allows you to change what the time separator is. This
is only valid in combination with some of the timeFormat values (according
to system rules). </td>
</tr>
<tr><td valign="top" headers="d0e19 ">trace</td>
<td valign="top" headers="d0e21 ">true, false</td>
<td valign="top" headers="d0e23 ">This property allows for turning on tracing of the connection. It can
be used as a simple debugging aide. <p>The default value is false, which
does not use tracing.</p>
</td>
</tr>
<tr><td valign="top" headers="d0e19 ">transaction isolation</td>
<td valign="top" headers="d0e21 ">none, read committed, read uncommitted, repeatable read, serializable</td>
<td valign="top" headers="d0e23 ">This property allows you to set the transaction isolation level for
the connection. There is no difference between setting this property to a
specific level and specifying a level on the setTransactionIsolation method
in the Connection interface. <p>The default value for this property is none,
as JDBC defaults to auto-commit mode.</p>
</td>
</tr>
<tr><td valign="top" headers="d0e19 ">translate binary</td>
<td valign="top" headers="d0e21 ">true, false</td>
<td valign="top" headers="d0e23 ">This property can be used to force the JDBC driver to treat binary
and varbinary data values as if they were char and varchar data values. <p>The
default for this property is false, where binary data is not treated the same
as character data.</p>
</td>
</tr>
<tr><td valign="top" headers="d0e19 ">translate hex</td>
<td valign="top" headers="d0e21 ">binary, character</td>
<td valign="top" headers="d0e23 ">This value is used to select the data type used by hex constants in
SQL expression. The binary setting indicates that hex contants will use the
BINARY data type. The character setting indicates that
hex contants will use the CHARACTER FOR BIT DATA data type. The default setting
is character. </td>
</tr>
<tr><td valign="top" headers="d0e19 ">use block insert</td>
<td valign="top" headers="d0e21 ">true, false</td>
<td valign="top" headers="d0e23 ">This property allows the native JDBC driver to go into a block insert
mode for inserting blocks of data into the database. This is an optimized
version of the batch update. This optimized mode can only be used in applications
that ensure that they do not break certain system constraints or data insert
failures and potentially corrupt data. <p>Applications that turn on this
property only connect to the local system when attempting to perform batched
updates. They do use DRDA<sup>®</sup> to establish remote connections because blocked
insert cannot be managed over DRDA.</p>
<p>Applications must also ensure
that PreparedStatements with an SQL insert statement and a values clause make
all the insert values parameters. No constants are permitted in the values
list. This is a requirement of the blocked insert engine of the system.</p>
<p>The
default is false.</p>
</td>
</tr>
<tr><td valign="top" headers="d0e19 ">user</td>
<td valign="top" headers="d0e21 ">anything</td>
<td valign="top" headers="d0e23 ">This property allows for a user ID to be specified for the connection.
This property does not work correctly without also specifying the password
property. These properties allow for connections to be made to the database
as a user other than the one that is running the iSeries job. <p>Specifying the user
and password properties has the same effect as using the connection method
with the signature getConnection(String url, String userId, String password).</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div>
<ul class="ullinks">
<li class="ulchildlink"><strong><a href="udbdatasourcebind.htm">Example: Create a UDBDataSource and bind it with JNDI</a></strong><br />
This is an example of how to create a UDBDataSource and get it bound with JNDI.</li>
<li class="ulchildlink"><strong><a href="udbdatasourcebind2.htm">Example: Create a UDBDataSourceBind and set DataSource properties</a></strong><br />
This is an example of how to create a UDBDataSource, and set the user ID and password as DataSource properties.</li>
<li class="ulchildlink"><strong><a href="udbdatasourceuse.htm">Example: Obtain an initial context before binding UDBDataSource</a></strong><br />
The following example obtains an initial context before binding the UDBDataSource. The lookup method is then used on that context to return an object of type DataSource for the application to use.</li>
<li class="ulchildlink"><strong><a href="udbdatasourceuse2.htm">Example: Create a UDBDataSource, and obtain a user ID and password</a></strong><br />
This is an example of how to create a UDBDataSource, and use the getConnection method to obtain a user ID and password at runtime.</li>
</ul>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="connects.htm" title="The Connection object represents a connection to a data source in Java Database Connectivity (JDBC). It is through Connection objects that Statement objects are created for processing SQL statements against the database. An application program can have multiple connections at one time. These Connection objects can all connect to the same database or connect to different databases.">Connections</a></div>
</div>
<div class="relconcepts"><strong>Related concepts</strong><br />
<div><a href="db2drivr.htm" title="DriverManager is a static class in the Java 2 Software Development Kit (J2SDK). DriverManager manages the set of Java Database Connectivity (JDBC) drivers that are available for an application to use.">DriverManager</a></div>
<div><a href="udbdatsr.htm" title="DataSource interfaces were designed to allow additional flexibility in using Java Database Connectivity (JDBC) drivers.">Use DataSources with UDBDataSource</a></div>
<div><a href="otherdts.htm" title="There are two implementations of the DataSource interface that are included with the native JDBC driver. These DataSource implementations should be considered deprecated. While you can still use them, they are not enhanced with future improvements; for example, robust connection and statement pooling are not added to these implementations. These implementations exist until you adopt the UDBDataSource interface and its related functions.">Other DataSource implementations</a></div>
</div>
<div class="relref"><strong>Related reference</strong><br />
<div><a href="dasrprop.htm" title="This table contains valid data source properties, their values, and their descriptions.">DataSource properties</a></div>
</div>
</div>
</body>
</html>