Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <blockquote> <p>Is there a standard way to define a JDBC datasource and deploy it ?</p> </blockquote> <p>No, this is container specific. As <a href="http://java.sun.com/javaee/5/docs/tutorial/doc/bnaca.html#bnacd" rel="nofollow noreferrer">Application Component Provider</a>, you're supposed to document the resources you need and the <a href="http://java.sun.com/javaee/5/docs/tutorial/doc/bnaca.html#bnaci" rel="nofollow noreferrer">Application deployer and Administrator</a> will configure them.</p> <blockquote> <p>If there is no standard way, will other containers at least accept the JBoss way?</p> </blockquote> <p>No, because this is the JBoss way and thus JBoss specific. </p> <ul> <li>With Tomcat, you would have to use the <a href="http://tomcat.apache.org/tomcat-6.0-doc/jndi-datasource-examples-howto.html" rel="nofollow noreferrer"><code>context.xml</code></a> file. </li> <li>With Jetty, <code>jetty-env.xml</code>. </li> <li>With WebSphere, you can create a so called <a href="https://stackoverflow.com/questions/2060368/what-is-the-difference-between-an-ear-file-and-a-websphere-enhanced-ear/2060743">WebSphere Enhanced EAR</a>.</li> <li>With WebLogic, you can package a <a href="http://download.oracle.com/docs/cd/E12840_01/wls/docs103/jdbc_admin/packagedjdbc.html" rel="nofollow noreferrer">JDBC Module</a> in your application.</li> <li>With GlassFish, you can use the command <code>asadmin add-resources my.xml</code> to add a datasource described in a XML file (example <a href="http://javahowto.blogspot.com/2006/08/access-glassfish-datasource-remotely.html" rel="nofollow noreferrer">here</a>).</li> <li>Etc, etc.</li> </ul> <p>Note that there are some projects trying to achieve this goal in a universal way like <a href="http://code.google.com/p/jndi-resources/" rel="nofollow noreferrer">jndi-resources</a> or <a href="http://cargo.codehaus.org/DataSource+and+Resource+Support" rel="nofollow noreferrer">Cargo</a>. There are also more complex solution like <a href="http://controltier.org/wiki/Main_Page" rel="nofollow noreferrer">ControlTier</a> or <a href="http://wiki.opscode.com/display/chef/Home" rel="nofollow noreferrer">Chef</a>.</p> <p>Now, in your case (as I understood you want to use an embedded database that will be bundled with your application), I don't think you should configure a datasource at the application server level. You should just package the jar of your database in your application with a standalone connection pool like c3p0 or DBCP. </p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload