Properties For The Ibm Data Server Driver For Jdbc And Sqlj - IBM DB2 Manual

Table of Contents

Advertisement

|
Table 29. Examples of updating DATE, TIME, or TIMESTAMP SQL values with Java date, time, or timestamp values
|
that do not represent real dates or times (continued)
|
Target type in
|
| |
String input value
database
| | |
25:00:00
TIME
| | |
24:00:00
TIME
|
| |
2008-15-36
TIMESTAMP
|
28:63:74.0
|
| |
9999-12-31
TIMESTAMP
|
|
24:00:00.0
|
|
|
|
| |
Table 30. Results of retrieving DATE, TIME, or TIMESTAMP SQL values that do not represent real dates or times into
|
Java application variables
|
|
|
|
|
| |
SELECT statement
|
|
| |
SELECT TS_COL
|
|
FROM TABLE1
| | |
|
SELECT TS_COL
|
FROM TABLE1
|
| |
|
SELECT
|
|
CHAR(TS_COL)
|
FROM TABLE1
| | |
|
SELECT
|
|
CHAR(TS_COL)
|
FROM TABLE1
|
|
|
|

Properties for the IBM Data Server Driver for JDBC and SQLJ

Value sent to table column, or exception
01:00:00
00:00:00
2009-04-06 05:04:14.0
Exception, because the adjusted value (10000-01-01 00:00:00.0) exceeds the
maximum year of 9999.
The following examples demonstrate the results of retrieving data from
TIMESTAMP columns in JDBC or SQLJ applications, when the values in those
columns do not represent real dates or times.
Value in TIMESTAMP
column TS_COL
2000-01-01 24:00:00.000000
2000-01-01 24:00:00.000000
2000-01-01 24:00:00.000000
2000-01-01 24:00:00.000000
Related reference
"JDBC differences between the current IBM Data Server Driver for JDBC and
SQLJ and earlier DB2 JDBC drivers" on page 370
IBM Data Server Driver for JDBC and SQLJ properties define how the connection
to a particular data source should be made. Most properties can be set for a
DataSource object or for a Connection object.
Methods for setting the properties
Properties can be set in one of the following ways:
v Using setXXX methods, where XXX is the unqualified property name, with the
first character capitalized.
Properties are applicable to the following IBM Data Server Driver for JDBC and
SQLJ-specific implementations that inherit from
com.ibm.db2.jcc.DB2BaseDataSource:
– com.ibm.db2.jcc.DB2SimpleDataSource
– com.ibm.db2.jcc.DB2ConnectionPoolDataSource
– com.ibm.db2.jcc.DB2XADataSource
Target type in
application (getXXX
method for retrieval)
Value retrieved from table column
java.sql.Timestamp
2000-01-02 00:00:00.000000
(getTimestamp)
String (getString)
2000-01-02 00:00:00.000000
java.sql.Timestamp
2000-01-02 00:00:00.000000
(getTimestamp)
String (getString)
2000-01-01 24:00:00.000000 (no adjustment
by Java)
Chapter 7. JDBC and SQLJ reference information
201

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents