I'm trying to use 
http://www.h2database.com/javadoc/org/h2/jdbcx/JdbcConnectionPool.html for 
pooling connections in jetty via JNDI Resource.

This is the jetty-env.xml -

<Configure class="org.eclipse.jetty.webapp.WebAppContext">
    <New class="org.eclipse.jetty.plus.jndi.Resource">
        <Arg></Arg>
        <Arg>jdbc/cp</Arg>
        <Arg>
            <Call class="org.h2.jdbcx.JdbcConnectionPool" name="create">
                <Arg>jdbc:h2:<Property name="jetty.home" 
default="."/>/db1;AUTO_SERVER=TRUE</Arg>
                <Arg>sa</Arg>
                <Arg />
            </Call>
        </Arg>
    </New>
</Configure>

In servlet -

@Resource(name="jdbc/cp", type=JdbcConnectionPool.class)
private JdbcConnectionPool cp;

A instanceof check tells me cp is a valid object in doGet(), but when I try 
getConnection it throws null pointer exception. 

How to use this with jetty?

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to