-
1. Re: Whether our Plugin can support JNDI
lkrejci May 2, 2013 5:25 AM (in response to arun2arunraj)1 of 1 people found this helpfulIt depends on what you want to do
If you want to access a JNDI resource from an agent plugin, putting the datasource into RHQ server will not help you, because it won't be available in the agent. Therefore, in your agent plugin you would need to carry all the libraries necessary to connect to your JNDI server of choice and manage the connection to it on your own in your agent plugin code.
If you want to modify RHQ server itself or write a server plugin, you will be able to access your datasource. You can look here https://docs.jboss.org/author/display/RHQ/Server+Plugin+Development to see what RHQ server plugins are about.
-
2. Re: Whether our Plugin can support JNDI
arun2arunraj May 2, 2013 5:56 AM (in response to lkrejci)Hi Lukas,
I want to connect JNDI from my Agent. For that, could you tell the files which I am missing ( mysql-connector-java.jar , jndi-properties.jar,jndi-1.2.1.jar,mysql-ds.xml , mysql-jdbc2-service.xml ). I think I am missing binding files. Can you help you to find a good path.
Regards,
ArunRaj.
-
3. Re: Whether our Plugin can support JNDI
tsegismont May 2, 2013 6:05 AM (in response to arun2arunraj)Arun,
You can't do that. If you want your plugin to execute queries to a MySQL database, then make sure you plugins ships MySQL connector and create JDBC connections in your plugin code (or use an existing JDBC connection pool).
Thomas
-
4. Re: Whether our Plugin can support JNDI
arun2arunraj May 2, 2013 6:30 AM (in response to tsegismont)Hi Thoms,
Can you share your knowledge, Why we cant do it ?.
I am curious to know the reasons and what to upgrade myself to the industries standard. As per this article, JNDI is the best than JDBC Connection pooling. And RHQAgent is running in jvm (If we are supplied any API, So it can run that). And of course, JDBC Connection poolings are possible. Then why we cant access JNDI in rhq agent. Please guide as always you guys do.
Regards,
ArunRaj
-
5. Re: Whether our Plugin can support JNDI
tsegismont May 2, 2013 8:17 AM (in response to arun2arunraj)You can connect to a remote JNDI server from any JVM. But you can't retrieve a Datasource object.
Yes Datasources in JNDI are the preferred way to get JDBC connections in an application server. But if you want to query a database from your plugin code, which will run in the agent JVM, then create JDBC connections manually or use a JDBC connection pool like commons-dbcp or C3P0.
-
6. Re: Whether our Plugin can support JNDI
arun2arunraj May 2, 2013 8:32 AM (in response to arun2arunraj)Hi Thomas,
I understand your point. Thank you so much for guiding me.
Regards,
ArunRaj.