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
true and false are keywords?
true, false, and null might seem like keywords, but they are actually literals. You cannot use them as identifiers in your programs.
Famous Quotations
Before you go and criticize the younger generation, just remember who raised them.
-- Unknown Author

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.