Subject | Re: Firebirdsql and Jboss Connection pooling, how to use it? |
---|---|
Author | jwcanada |
Post date | 2002-01-11T09:34Z |
David,
Thank you for the example. Here is a document on how to use jndi.
http://jakarta.apache.org/tomcat/tomcat-4.0-doc/jndi-resources-
howto.html
If use the codes below, what is the purpose of using JBoss Pooling as
your wrapped Datasouce has already provided?
jw
Thank you for the example. Here is a document on how to use jndi.
http://jakarta.apache.org/tomcat/tomcat-4.0-doc/jndi-resources-
howto.html
If use the codes below, what is the purpose of using JBoss Pooling as
your wrapped Datasouce has already provided?
jw
--- In IB-Java@y..., David Jencks <davidjencks@d...> wrote:
> >
>
> I think executing code like this on container startup will work:
>
> private final static String DB_DATASOURCE_URL =
> "localhost/3050:tmp/testfb.gdb";
> private final static String DB_USER = "sysdba";
> private final static String DB_PASSWORD = "masterkey";
> private final static String JNDI_NAME = "java:/firebirdSQLDS";
>
>
>
> FBWrappingDataSource ds = new FBWrappingDataSource();
> ds.setDatabaseName(DB_DATASOURCE_URL);
> ds.setUser(DB_USER);
> ds.setPassword(DB_PASSWORD);
> ds.setMinSize(3);
> ds.setMaxSize(5);
> ds.setBlockingTimeout(1000);
> ds.setIdleTimeoutMinutes(15);
> ds.setPooling(true);
>
> InitialContext ctx = new InitialConext();
> ctx.bind(JNDI_NAME, ds);
>
> Note that the db url is not a jdbc url and DOES NOT have
jdbc:firebirdsql:
> at the beginning.
>
> If you need each user to log on as themselves, I recommend not using
> pooling, unless you know for sure the maximum number of users.
Each user
> gets up to maxsize connections, rather than maxsize being the total
number
> of connections available for everyone together.
>
> I don't know what facilities tomcat provides for running code at
startup.
> This is one of the nice things about the jboss mbean architecture,
it is
> very easy.
>
> david jencks