Slakshmi 060001JD9S Visits (396)
Looking for a way to test Automatic Client Re-route using a simple JDBC program that uses IBM data server driver for JDBC & SQLJ (JCC) & JDBC DriverManager Connection?
Here are the steps to follow:
Step 1: UPDATE ALTERNATE SERVER INFORMATION in BOTH PRIMARY & STANDBY SERVERS:
Lets assume that following are the Primary and Standby Server's hostnames and Port numbers.
a) On DB2 Primary system:
Step 2: UPDATE THE JDBC CONNECTION URL WITH THE clie
Sample program to test the automatic Client re-route:
To compile the program:
Step 3: Once you run the above program, it connects to the primary. On the DB2 server, do a failover to the standby. Now the application will automatically re-route the connection to the former standby.
KateDawson 060001TQ2C Visits (481)
As we wind down 2013, we thought it would be fun to see our most popular posts of the year:
Here is a list of the most popular posts since launching this blog waaaaaaaay back in 2009:
And finally, here is a link to the 100 technical support tip series we ran in 2011 and 2012:
Tech Tip: IBM Universal JDBC Driver behavior when calling ResultSetMetaData.getColumnName and getColumnLabel against a DB2 LUW server
MaryKassey 270002GKDM Visits (1840)
For the IBM® Data Server Driver for JDBC and SQLJ version 4.0 and later, the default behavior of Resu
The following examples show the values that are returned for IBM Data Server Driver for JDBC and SQLJ Version 4.0, and for previous JDBC drivers, when the useJ
1) Example of Resu
2) Example of Resu
Conclusion: From the above examples, we see that 3.62.56 uses the label name getInt (DW_TRADE_HIER_ID) and
4.12.55 actually uses the column name getInt (DW_POSITION_ID). It is
expected that JCC throws an exception when using getColumnName with JDBC 4.0
driver. If users want to use getColumnName instead of getColumnLabel with JDBC 4.0
gorddbds 060001JCXS Visits (1371)
DB2 LUW provides the db2pd tool with two fmp options that when used in conjunction with each other can provide information which will identify the routine that was running in a particular db2fmp. The following technote documents a method to determine which db2fmp a routine ran in using the db2pd tool.
If a db2fmp entry is logged in the db2diag.log, the entry should contain the process ID (PID) and thread ID (TID). Below is a sample of a db2diag.log entry which identifies the db2fmp PID and TID.
PID : 59900132 TID : 0 PROC : db2fmp
Since the db2pd -fmp command described in the above technote returns the PID and TID as well as the routine name and time of the run, it is possible to use the information in the db2diag.log to map a routine to its db2fmp. Below is a sample of the output.
59900132 0 2012
So we can see from the above output that the db2fmp error occurred while running the routine SYSPROC.ADMIN_CMD
gorddbds 060001JCXS Visits (1216)
DB2 LUW is capable of running Java applications as stored procedures or user defined functions (Stored Procedures and UDFs are collectively referred to as routines). When a Java routine is invoked DB2 will load the class and start a JVM in a process called the db2fmp. Unlike other DB2 processes, this process is owned by the fenced user, so it is necessary for the fenced user ID to have access to the libraries containing the application classes and the JVM. By default the JDK that is shipped with DB2 is used. You can use a JDK other than the one shipped with DB2 by modifying the JDK_PATH dbm cfg variable to point to the location of the desired JDK. If you are using a 1.6 JDK it will be necessary to set the environment variable DB2LIBPATH to the path containing the JDK. Not every JDK is supported for running routines. Supported JDKs are documented in the DB2 Infocenter. The JDKs supported for version 9.7 are listed at the following URL.
In order to execute a Java routine DB2 will start a JVM in the db2fmp. On AIX systems the db2fmp will be unable to start a JVM if the Stack Execution Disable mode is set to “all' or “setidfiles”. If the SED is set to one of these modes it will be necessary to change the mode in order to run Java routines. You can verify the setting of the SED by issuing the command sedmgr.
For information on General routine performance including additional information on Java routines see the following URL.
See the following URL for information on modifying the dbm cfg variable JDK_PATH
Adam Koile 270000GAYM Visits (1602)
Looking for some helpful JDBC links then check these out:
Still have trouble or just have a question about the IBM JDBC driver, then comment below.