Download presentation
Presentation is loading. Please wait.
Published byBernard Rodgers Modified over 9 years ago
1
Enterprise Java v040918JBoss DataSource Setup1 Setting up DataSources in JBoss References: JBoss Wiki –http://www.jboss.org/wiki/Wiki.jsp?page=ConfigDataSourceshttp://www.jboss.org/wiki/Wiki.jsp?page=ConfigDataSources “Getting Started with JBoss, J2EE applications on the JBoss 3.2.x Server”, Luke Taylor and The JBoss Group. http://www.jboss.org/modules/html/docs/jbossj2ee.pdf
2
Enterprise Java v040918JBoss DataSource Setup2 JBoss DataSources Implemented using Java Connector Architecture (JCA) –Either directly supported by vendor or using JDBC wrapper Defined by a deployment descriptor ending in –ds.xml in ${JBOSS_SERVER}/deploy/ Vendor driver archive(s) placed in ${JBOSS_SERVER}/lib
3
Enterprise Java v040918JBoss DataSource Setup3 Database Sample Files Available ${JBOSS_HOME}/docs/examples/jca asapxcess-jb3.2-ds.xml informix-ds.xml mysql-ds.xml cicsr9s-service.xml informix-xa-ds.xml oracle-ds.xml db2-ds.xml jdatastore-ds.xml oracle-xa-ds.xml db2-xa-ds.xml jms-ds.xml postgres-ds.xml facets-ds.xml jsql-ds.xml progress-ds.xml fastobjects-jboss32-ds.xml lido-versant-service.xml sapdb-ds.xml firebird-ds.xml mimer-ds.xml sapr3-ds.xml generic-ds.xml mimer-xa-ds.xml solid-ds.xml hajndi-jms-ds.xml msaccess-ds.xml sybase-ds.xml hsqldb-ds.xml mssql-ds.xml hsqldb-encrypted-ds.xml mssql-xa-ds.xml
4
Enterprise Java v040918JBoss DataSource Setup4 Basics –ex. xxx-ds.xml – –... – – <mbean … –
5
Enterprise Java v040918JBoss DataSource Setup5 Types of DataSources no-tx-datasource –does not take part in JTA transactions using a java.sql.Driver –rare for databases local-tx-datasource –does not support two phase commit using a java.sql.Driver xa-tx-datasource –does support two phase commit using a javax.sql.XADataSource
6
Enterprise Java v040918JBoss DataSource Setup6 Common java.sql.Driver Properties connection-url –URL to database –ex. jdbc:hsqldb:hsql://localhost:9001 driver-class –vendor specific JDBC Driver in classpath –ex. org.hsqldb.jdbcDriver …
7
Enterprise Java v040918JBoss DataSource Setup7 Common javax.sql.DataSource Properties user-name –not used when security-domain specified password –not used when security-domain specified new-connection-sql –a test SQL statement which gets executed when connection taken from the pool to determine if connection still valid –ex. select * from small-table track-statements –watches for unclosed Statements and Result sets – nowarn closes resources without issuing warnings …
8
Enterprise Java v040918JBoss DataSource Setup8 Common javax.sql.XADataSource Properties xa-datasource-class –The vendor-specific class implementing XADataSource xa-datasource-property –properties to configure XADataSource –these vary per driver javap –classpath Driver –follow JavaBean semantics –ex. 10 driver.setIfxWAITTIME(String)
9
Enterprise Java v040918JBoss DataSource Setup9 Example local-tx and xa DataSources coredev/jdbc/pointbase/DS jdbc:pointbase:server://localhost:9092/coredev com.pointbase.jdbc.jdbcUniversalDriver pbpublic coredev/jdbc/pointbase/XaDS com.pointbase.xa.xaDataSource jdbc:pointbase:server://localhost:9092/coredev pbpublic
10
Enterprise Java v040918JBoss DataSource Setup10 Deploying local-tx and xa DataSources [WrapperDataSourceService] Bound connection factory for resource adapter for ConnectionManager 'jboss.jca:name=coredev/jdbc/pointbase/DS,service= DataSourceBinding to JNDI name 'java:coredev/jdbc/pointbase/DS' INFO [WrapperDataSourceService] Bound connection factory for resource adapter for ConnectionManager 'jboss.jca:name=coredev/jdbc/pointbase/XaDS,service= DataSourceBinding to JNDI name 'java:coredev/jdbc/pointbase/XaDS‘ java: Namespace +- coredev (class: org.jnp.interfaces.NamingContext) | +- jdbc (class: org.jnp.interfaces.NamingContext) | | +- pointbase (class: org.jnp.interfaces.NamingContext) | | | +- XaDS (class: javax.sql.DataSource) | | | +- DS (class: javax.sql.DataSource)
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.