Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

getting my data in server.xml to pojo file..?

 
santhosh.R gowda
Ranch Hand
Posts: 296
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear All

As we know through JNDI we can get the data base properties and we can connect to a perticular data base as defined in server.xml file but when we want my data other than data base like Table name of the data base because if tomorow i changed the table name with different but having same attributes in the prevoius table so that i can change in my server.xml . is it possible to get my own tag data into java code
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18156
53
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The JNDI connection pool doesn't specify table names, so that wouldn't help. Maybe you mean schema names.

You can update the connection pool configuration online via the Tomcat admin application or by using the JMX management console. However, if you switch databases, you have to stop and restart the webapp before the new pool can be used.

There's no reason why the webapp should know or care about the database name in most cases. I'd expect that if you really needed it (for a diagnostic webpage, for example), you could do a jdbc metadata request and that would return the current information direct from the database server itself. Which is more definitive anyway.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic