• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Configure DataSource via JMX

 
f roh
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,


Question:
Is it possible to configure the datasource of tomcat (any version) via JMX/MBeans?
If its possible will the changes be only transient (like JBoss) or can i persist them?

Why am i asking this:
i am trying to create a program which is able to deploy a file on a tomcat server and configure this server as described in a config file.


i do appreciate your help
thanks
fabian
 
Tim Holloway
Saloon Keeper
Pie
Posts: 17989
47
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the JavaRanch, Fabian!

Tomcat doesn't have "a" datasource, but it can support as many datasources as you want.

Most of the time I configure my datasources on a per-application basis, so I just put all that info in the context.xml file for the webapp along with all the other app config information. JBoss, however, goes for server-wide configurations. The view from the application is the same, however.

Using JMX to configure Tomcat is usually overkill, since you can't usually modify a database connection pool on the fly - you do it before the app goes online and (usually) leave it alone as long as the app is running, since otherwise you're in much the same situation as someone attempting to change tires on a moving automobile.

There are a number of ways to do what you're asking, but I'm actually not sure if they're worth the trouble.
 
f roh
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok,

thanks for the answer...

i think i will solve this issue with java IO and jdom. so just insert the datasource in the xml file.
i thought using jmx would be a nicer way because i could develop against the api.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic