Win a copy of Java Database Connections & Transactions (e-book only) this week in the JDBC forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Devaka Cooray
  • Knute Snortum
  • Paul Clapham
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Frits Walraven
  • Ganesh Patekar
  • Tim Holloway
  • salvin francis

Configure DataSource via JMX  RSS feed

Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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
Posts: 20766
Android Eclipse IDE Java Linux Redhat Tomcat Server
  • 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
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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.
That which doesn't kill us makes us stronger. I think a piece of pie wouldn't kill me. Tiny ad:
how do I do my own kindle-like thing - without amazon
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!