This content has been marked as final. Show 3 replies
Please make a Properties file inside <DOMAIN_HOME> and place the JNDI Name of the dataSource which you want to Use
Step1). Make a Properties file "whichDataSource.properties" inside <DOMAIN_HOME>
Step2). Now write a JSP page inside your Application to read the DataSource Name which you want to actually use currently:
<%@ page import="java.util.*" %>
<title>Hi It's Wroking</title>
<body bgcolor="maroon" text="white">
InputStream is=new FileInputStream("./a.properties");
Properties prop=new Properties();
out.println("DataSource Which you want to use: "+prop.getProperty("nowUseDataSource"));
InitialContext ic=new InistalContext();
Hi Jay SenSharma
Thanks for your reply.
is their any other way to get same functionality?
Please refer to : http://weblogic-wonders.com/weblogic/2010/05/31/overriding-properties-files-of-ear-applications/
In this case place any roperties file mentioning your DataSource JNDI name which your application want to Lookup... Then Using above techniqueue reload the fresh Properties file which has Another DataSource JNDI name to lookup.
It means the JNDI name present in the properties file will decide which DataSource will be looked up by your application code. And any time you can Change this Property file Which is pesent inide your Application using *"AppFileOverrides"* feature of WebLogic.