0

I have a requirement to display the database name on the screen that is connected by the web application (which is configured through the datasource on weblogic server with spring data xml having all the configurations) and also is there any way to switch from current database to different datasource (database server) while working/running on the web application (with user screen).

Thanks.

1 Answer 1

1

As far as I know, there is no straight-forward way to know this info. One way I can think of doing this is to parse the spring config XML file using an XML parser for the desired element - even that too will only give you the JNDI name of the datasource your app would be using. I hope you have a mechanism to determine which JDBC JNDI name maps to which database. If you don't have that information, you would have to use JMX (MBeans) to connect to the Weblogic environment to get that info.

Sign up to request clarification or add additional context in comments.

3 Comments

thanks for you info, i am trying to see the possible ways of implementing it. i have to look into the concepts of JMX to deal with this scenario.
Yes, JMX coding is not too difficult. Please look at this example to get the datasource properties using JMX - middlewaremagic.com/weblogic/?p=50
Thanks a lot Sonu, i will try to implement and test based on the above example.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.