You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Wes Clark <wc...@guidewire.com> on 2014/07/23 01:20:27 UTC

Tomcat JDBC Connection Pool initialization question

I want to initialized a new connection being added to the pool with more than one SQL statement.  I cannot see how to override the existing methods to do this.  Has anyone done this, or have a suggestion for me?


RE: Tomcat JDBC Connection Pool initialization question

Posted by Wes Clark <wc...@guidewire.com>.
That worked for H2.  For Oracle, however, I had to get more cleaver:

Here is the string that worked:

BEGIN
EXECUTE IMMEDIATE 'ALTER SESSION SET STATISTICS_LEVEL = ALL';
EXECUTE IMMEDIATE 'ALTER SESSION SET CURSOR_SHARING = EXACT';
DBMS_APPLICATION_INFO.SET_MODULE('ExampleCenter', NULL);
EXECUTE IMMEDIATE 'ALTER SESSION SET NLS_SORT = BINARY_CI';
EXECUTE IMMEDIATE 'ALTER SESSION SET NLS_COMP = BINARY';
END;

I haven't tried SQL Server, yet, but I don't think I have a requirement there.

I don't really like the design of using the same method to run the connection 
initialization query (s/b queries) and the connection validation query in the 
same place.  Also, I think the design should allow multiple DDL or DML statements
be run the initialize the connection.

-----Original Message-----
From: Felix Schumacher [mailto:felix.schumacher@internetallee.de] 
Sent: Tuesday, July 22, 2014 11:07 PM
To: Tomcat Users List
Subject: Re: Tomcat JDBC Connection Pool initialization question



On 23. Juli 2014 01:20:27 MESZ, Wes Clark <wc...@guidewire.com> wrote:
>I want to initialized a new connection being added to the pool with 
>more than one SQL statement.  I cannot see how to override the existing 
>methods to do this.  Has anyone done this, or have a suggestion for me?

Have you tried to separate them with a semicolon?

Something like
"SELECT 1; SELECT 2"

Regards
Felix


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Tomcat JDBC Connection Pool initialization question

Posted by Felix Schumacher <fe...@internetallee.de>.

On 23. Juli 2014 01:20:27 MESZ, Wes Clark <wc...@guidewire.com> wrote:
>I want to initialized a new connection being added to the pool with
>more than one SQL statement.  I cannot see how to override the existing
>methods to do this.  Has anyone done this, or have a suggestion for me?

Have you tried to separate them with a semicolon?

Something like
"SELECT 1; SELECT 2"

Regards
Felix


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org