Adsense

Thursday, August 13, 2015

IBM Change Data Capture (CDC) Replication step by step guide to install, configure and create instance

This tutorial covers step by step guide  to install and  configure  IBM Change Data Capture (CDC) (Data Replication)  in Linux machine. Also covers that how to create CDC instance for replications. Now let us see the steps to install and configure Change Data Capture in Linux. Brief Steps 1. Install IBM Change Data Capture Engine (IBM CDC) (in this example, version 6.5) on both source and target machines 2. Create CDC instance on both servers 3. Install Access Server, create  user and start Access Server. 4. Install...

Thursday, May 14, 2015

db2diag log file path location and how to change location, size and reset db2diag.log file

db2diag.log file is useful for DBA for trouble shooting the database.  All errors, warnings, event messages, and administration notification messages  starting from installation are captured in the db2diag.log file. Also any failure in the db2 server / database are captured in db2diag.log file. DBA  can use this log file and trace.  We can use db2diag tool with various options for reading and displaying db2diag.log file. db2diag.log...

Sunday, March 22, 2015

JNDI DataSource Configuration in JBoss with DB2 in Eclipse Example

Assume that Eclipse is configured with JBoss Application Server 4.0. Before an application can get data from any Database (db2, Postgress, MySql , Oracle, etc..), it needs to establish a connection to the database. In our example we are going to connect with db2 database (eg. Employee). This can be done using JDBC in following ways. 1. Use the DriverManager class to establish a connection -> Load the Db2 JDBC Driver using Class.forName() & Create a connection to a db2 database using DriverManager.getConnection() method 2. Connect to...

Error "The CODEPAGE option is incompatible with the LOBSINFILE option" Solution

Error : The "CODEPAGE" option is incompatible with the "LOBSINFILE" option Cause of the Error: The error comes due to code page mismatch between source database and target database. See the below example.  CODEPAGE is page encoding. By default OS also having default encoding (1252). db2move sourceDB export                           - where codepage of sourceDB was set to 1208 db2move targetDB import                      ...

Sunday, December 21, 2014

How to Configure JDBC Datasource (JNDI) in Tomcat 7 with DB2 in Ecplise Example.

The following steps tells how to Configure JDBC Data Resources (JNDI) in Tomcat 7 with DB2 in Ecplise with Example. Assume that Eclipse is configured with Apache Tomcat Application Server 7.0. A database connection pool creates and manages a pool of connections to a database. It is always better to recycle and reuse already existing connections to a dB than opening a new connection. Tomcat supports DBCP connection pool from the Commons project by default. It is also possible to use any other connection pool that implements javax.sql.DataSource Suppose...

Sunday, December 14, 2014

Java to create & use DataSource Object in DB2 in the application using DataSource interface without using tools

The preferred way to connect to a database is using DataSource interface rather than using DriverManager interface. DriverManager class requires JDBC driver class name and driver URL. So we have to mention the Driver class and Driver URL which are specific to a JDBC vendor, driver implementation. This reduces the Portabilty of the Application. To improve potability of your applications among data sources, DataSource interface may be used. JDBC version 2.0 provides the DataSource interface. The following program creates datasource object to connect...

Sunday, November 30, 2014

How to display the number of rows affected in DB2 INSERT / DELETE / UPDATE / MERGE commands

 By default, DB2 does not print the number of records affected when we run the DML  commands like INSERT,  DELETE, UPDATE or MERGE in the command prompt. So to display number of records affected when you run the above DML commands, you can use  following options. You  can use the option m, in the command itself as given below db2 -m update employee set payscale='42000-3%-72000' where doj<='1976-01-01'   Number of rows affected : 50 DB20000I  The SQL command completed successfully. Also, You...