我的问题是我在 jboss 部署文件夹中配置了一个 oracle-ds.xml。我可以得到dataSource和connection的实例。现在,我想通过 jboss api 从数据库配置中获取密码。此刻我能做什么?
数据库配置:
<datasources>
<xa-datasource>
<jndi-name>XPCDataSource</jndi-name>
<track-connection-by-tx/>
<isSameRM-override-value>false</isSameRM-override-value>
<xa-datasource-class>oracle.jdbc.xa.client.OracleXADataSource</xa-datasource-class>
<xa-datasource-property name="URL">jdbc:oracle:thin:@172.17.16.49:1521:ora49</xa-datasource-property>
<xa-datasource-property name="User">workbench_0628</xa-datasource-property>
<xa-datasource-property name="Password">workbench_0628</xa-datasource-property>
<min-pool-size>10</min-pool-size>
<max-pool-size>50</max-pool-size>
<exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name>
<!-- Oracles XA datasource cannot reuse a connection outside a transaction once enlisted in a global transaction and vice-versa -->
<no-tx-separate-pools/>
<metadata>
<type-mapping>Oracle9i</type-mapping>
</metadata>
</xa-datasource>
<mbean code="org.jboss.resource.adapter.jdbc.vendor.OracleXAExceptionFormatter" name="jboss.jca:service=OracleXAExceptionFormatter">
<depends optional-attribute-name="TransactionManagerService">jboss:service=TransactionManager</depends>
</mbean>
</datasources>