Developing Java applications for high availability
DB2 provides high availability solutions (also known as HA) to handle site failures. HA involves two clone servers that act as primary and secondary. When the primary server goes down, DB2 allows the secondary server to take over automatically. Once the secondary server takes over, the entire database traffic is automatically routed to the secondary server. This rerouting is implemented at the server and client side. In this recipe, we will discuss how we can make our Java applications use high-availability features to reroute to the secondary server.
Getting ready
The client applications can use the following features to achieve high availability:
Automatic client reroute: The rerouting information that includes the information about the secondary server is available at the database server. At the client side, the client application uses this information for routing to the secondary server when the primary server goes down. This rerouting...