[jboss-user] [JCA/JBoss] - Custom DataSource configuration (instantiation)

wwebber do-not-reply at jboss.com
Fri Sep 14 10:40:07 EDT 2007


Hello all;
  I am trying to configure a custom DataSource in JBoss 4.0.5, and have assumed that this might be possible via configuration info put into a *-ds.xml file. The company I worked for has a corporate development standard that forces developers to use a custom subclass of the OracleConnectionPoolDataSource class. So far, the company has been developing non-ejb Tomcat web apps, where doing what I describe is a cinch {creating custom DataSource pools with a handrolled pool impl}.  
   Looking through the JBoss docs, and others areas, I see TONS of examples configuring a DataSource where a JBoss DataSource  implementation class will be used (and you are just specifying the Driver for each real connection..) , but none where you specify a different DataSource Impl. 
    Judging by the dtd for the *-ds.xml files, it doesn't look possible looking at valid attributes. Is there perhaps another way to pull this off? In theory, if you could do this it might look something like below (note: I an just making this up, it doesn't really work)

<local-tx-datasource class="myOracleSubClass" >
  |   <jndi-name>scoobyDo</jndi-name>
  |      <connection-url>
  |        jdbc:oracle:thin:mySchema/mySchema@//myPass:1521/myMachine
  |     </connection-url>                    
  |     <driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
  |     <min-pool-size>1</min-pool-size>
  |     <max-pool-size>5</max-pool-size>
  | </local-tx-datasource>

Or maybe.......

<local-tx-datasource>
  |   <property name = "class" class="myOracleSubClass"/>
  |   <property name = "driver" class="oracle.jdbc.driver.OracleDriver"/>
  |   <property name = "class" class="myOracleSubClass"/>
  |   <property name = "jndiName" class="scoobyDoo"/>
  |   <property name = "minConnections" class= "1" />
  |    ...........
  | </local-tx-datasource>



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

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



More information about the jboss-user mailing list