[jboss-user] [JCA/JBoss] - How to access the configured datasource

joy_wind do-not-reply at jboss.com
Sun Aug 13 09:41:02 EDT 2006


Hi,I have config a datasource like the following:

<local-tx-datasource>
<jndi-name>PostgresDS</jndi-name>
<connection-url>jdbc:postgresql://localhost:5432/eai</connection-url>
<driver-class>org.postgresql.Driver</driver-class>
<user-name>postgres</user-name>
postgres
<min-pool-size>5</min-pool-size>
<max-pool-size>100</max-pool-size>
<new-connection-sql>select 1</new-connection-sql>
<check-valid-connection-sql>select 1</check-valid-connection-sql>

<!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml (optional) -->

<type-mapping>PostgreSQL 7.2</type-mapping>

</local-tx-datasource>


Then

1, how can I get the datasource object so to get a connection ? Since my web app is in the save JVM, could i get the datasource directly without a jndi lookup (may fetch the datasource mbean directly ?)? some code snippet will be really appreciated.

2,Is the database connections REALLY been pooled ,according the config like above ?

3,how to config to let jboss server initiate serveral database connection when startup?

I'm totally new to jboss.I have searched the web for a while but find no result.Anyone can help me ? Thanks!

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3964838#3964838

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3964838



More information about the jboss-user mailing list