title: create a jboss datasource connection pool dynamically
body: <p>I've been asked to write some code which can create multiple jboss datasource connection pools programatically upon startup.</p>
  
  <p>I've done this using a shell script which generates -ds.xml files at startup, which jboss then reads, but I've been told it must be done programmatically in Java.</p>
  
  <p>Of course I can create the datasources myself, that's easy enough, but we need to use a jboss connection pool with a configurable max and min pool size, bound in JNDI.  I'd rather not write my own connection pool implementation...</p>
  
  <p>And just to make the problem that much harder, we're using jboss 5.0.1 and no we can't upgrade it for this task.</p>
  
  <p>Is this even possible?</p>
  
  <p>-edit-</p>
  
  <p>So I can do this:</p>
  
  <pre><code>   OracleDataSource ds = new OracleDataSource();
     ds.setURL(url);
     ds.setUser(user); 
     ds.setPassword(pass); 
     Context ctx = JndiLookups.getInitialContext();
     ctx.bind(dsName, ds);
  </code></pre>
  
  <p>But I don't think this gives me connection pooling, does it?  I need to be able to specify a connection pool size, blocking timeout, etc</p>