commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "McKinstry, Pete (HQP)" <Pete.McKins...@rhi.com>
Subject [DBCP] post createConnection() initialization.
Date Tue, 30 Jul 2002 16:41:55 GMT
Was any support ever added for running an initialization statement after
creating a new connection? I needed something similar for calling "use
schema ?" in db2, so I created an "InitializingConnectionFactory" decorator
class that wraps the createConnection() call & executes an arbitrary SQL
statement after each create. Example usage: (creation)
	ConnectionFactory conFactory = 
		new DriverManagerConnectionFactory(db_url, username,
password);
	// Wrapper factory that allows execution of initialization SQL
	ConnectionFactory initFactory = 
		new InitializingConnectionFactory(conFactory, sql);

I'd be happy to contribute it back to DBCP if the maintainers are
interested.

-pgm

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message