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
Purpose of garbage collection
The garbage collection process is to identify the objects which are no longer referenced or needed by a program so that their resources can be reclaimed and reused. These identified objects will be discarded.
Famous Quotations
It is easier to fight for one’s principles than to live up to them.
-- Alfred Adler

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 © 2017 by Nataraja Gootooru. All Rights Reserved.