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
Different types of Access Modifiers
public: Any thing declared as public can be accessed from anywhere.

private: Any thing declared as private can't be seen outside of its class.

protected: Any thing declared as protected can be accessed by classes in the same package and subclasses in the other packages.

default modifier: Can be accessed only to classes in the same package.
Famous Quotations
I respect faith, but doubt is what gets you an education.
-- Wilson Mizner

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.