JAVA EXAMPLE PROGRAMS

JAVA EXAMPLE PROGRAMS

Publish Your Article Here

How to configure database failover and high availability in JBoss 7 Datasource?


If we are configuring our application for high availability and disaster recover, it is mandatory to have failover configurations at DB datasource level as well. In this page, we described how to configure database failover in JBoss 7. Close watch below JBoss datasource configurations. The "connection-url" tag contains two connection urls with a delimiter "|". The delimiter character also required to mention with "url-delimiter" tag.

With this failover configuration, JBoss connects to the first specified DB. On any failure, JBoss tries to connect to second DB url.

<datasource jndi-name="java:jboss/jdbc/HADatasource" pool-name="HADatasource" 
												enabled="true" use-java-context="true">
	<connection-url>
		jdbc:oracle:thin:@db-host:db-port/service|jdbc:oracle:thin:@db-host:db-port/service
	</connection-url>
	<url-delimiter>|</url-delimiter>
	<driver>oracle</driver>
	<security>
		<user-name>user-name</user-name>
		<password>password</password>
	</security>
</datasource>
<< Previous Program 

JBoss configuration examples

  1. How to start/stop JBoss AS 7 in standalone mode?
  2. How to load external property file in JBoss 7 classpath?
  3. How to configure Data Source (JDBC Connection Pool) in JBoss AS 7 standalone mode?
  4. How to configure database failover and high availability in JBoss 7 Datasource?
Knowledge Centre
Domain Naming Service(DNS)
It is very difficult to remember a set of numbers (IP address) to connect to the Internet. The Domain Naming Service(DNS) is used to overcome this problem. It maps one particular IP address to a string of characters. For example, www.java2novice.com implies com is the domain name reserved for US commercial sites, java2novice is the name of the company and www is the name of the specific computer, which is java2novice's server.
Famous Quotations
Tomorrow is often the busiest day of the week.
-- Spanish Proverb

About Author

I'm Nataraja Gootooru, programmer by profession and passionate about technologies. All examples given here are as simple as possible to help beginners. The source code is compiled and tested in my dev environment.

If you come across any mistakes or bugs, please email me to [email protected].

Most Visited Pages

Other Interesting Sites

Reference: Java™ Platform Standard Ed. 7 - API Specification | Java™ Platform Standard Ed. 8 - API Specification | Java is registered trademark of Oracle.
Privacy Policy | Copyright © 2022 by Nataraja Gootooru. All Rights Reserved.