[jboss-user] how to access ManagedConnectionFactory properties

torsten.reinhard at gi-de.com torsten.reinhard at gi-de.com
Thu Oct 22 03:53:57 EDT 2009


Hi, 

with JMX i can retrieve the properties of a managed (database) connection:

    private Element getManagedConnectionFactoryProperties(final 
MBeanServerConnection server, final String jndiName)
        throws Exception
    {
        String objectNameParam = 
"jboss.jca:service=ManagedConnectionFactory,name=" + jndiName;
        ObjectName oJdbc = new ObjectName(objectNameParam);

        return (Element) server.getAttribute(oJdbc, 
"ManagedConnectionFactoryProperties");
    }

The "element" looks like:

 * <properties>
 *    <config-property name='ConnectionURL' 
type='java.lang.String'>jdbc:db2://10.9.33.186:50001/cams181u</config-property>
 *    <config-property name='DriverClass' 
type='java.lang.String'>com.ibm.db2.jcc.DB2Driver</config-property>
 *    <config-property name='UserName' 
type='java.lang.String'>camsuser</config-property>
 *    <config-property name='Password' 
type='java.lang.String'>camsuser</config-property>
 *    <config-property name='CheckValidConnectionSQL' 
type='java.lang.String'>select 1 from SYSIBM.SYSDUMMY1</config-property>
 *    <config-property name='TrackStatements' 
type='java.lang.String'>false</config-property>
 *    <config-property name='ValidateOnMatch' 
type='boolean'>true</config-property>
 *    <config-property name='ConnectionProperties' 
type='java.lang.String'>
 *      progressiveStreaming=2
 *      currentSchema=CAMSSCHEMA
 *      
currentFunctionPath=&quot;SYSIBM&quot;,&quot;SYSFUN&quot;,&quot;SYSPROC&quot;,&quot;SYSIBMADM&quot;,&quot;CAMSSCHEMA&quot;
 *      progressiveStreaming=2
 *    </config-property>
 * </properties>

Is there a common class availabe I could pass this Element, and access the 
config-property values with get...() methods?
Or do I need to write my own DOM parsing, using XPath for example?

Thanx, Torsten
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20091022/27e874f6/attachment.html 


More information about the jboss-user mailing list