Re: Access tomcat instance from Java application
On 06/22/2015 02:28 PM, David kerber wrote: Or are you trying to use the database connection information in your tomcat installation, in a standalone java program? I think to do that, you will need to read in the .xml files and parse out the information you want from there. That's precisely what I wanted to do. I ended up writing my database information via custom XML schema into another file, then parse that file and create my own DataSource with the Tomcat DataSourceFactory and provide that to the JNDI of Tomcat. Then I removed the database configuration in Tomcat and the result is: I now have a central point of configuration which my program AND Tomcat can use. Thanks for your response. I thought maybe I overlooked something and I can access the Naming Resources of a running Tomcat instance in my program. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Access tomcat instance from Java application
On 6/20/2015 1:57 PM, Daniel Mierswa wrote: Good afternoon list, I would like to know how to access a running tomcat installation from within another Java application which is not running in the tomcat container. More specifically I would like to end up using the datasource which is configured via in the server.xml. This would allow me to use an existing configuration and so I wouldn't need to specify the jdbc parameters and dialect etc. somewhere else to get a connection pool. You seem to be mixing two different kinds of connections here. First you say you want to connect to another Tomcat installation. I do that with HTTP connections in Java. Then you talk about what appear to be database connections. Or are you trying to use the database connection information in your tomcat installation, in a standalone java program? I think to do that, you will need to read in the .xml files and parse out the information you want from there. Thanks for reading. Daniel - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Access tomcat instance from Java application
Good afternoon list, I would like to know how to access a running tomcat installation from within another Java application which is not running in the tomcat container. More specifically I would like to end up using the datasource which is configured via in the server.xml. This would allow me to use an existing configuration and so I wouldn't need to specify the jdbc parameters and dialect etc. somewhere else to get a connection pool. Thanks for reading. Daniel - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org