commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Keates, Mark" <Mark.Kea...@dendrite.com>
Subject [DBCP] Oracle NlsDateFormat
Date Wed, 17 Dec 2003 13:57:18 GMT
Hi,

When using a servlet engine to connect to different Oracle databases,
which can have differing default date formats, is it the responsibility of
the
servlet to execute an ALTER SESSION if I want to use a specific
date format in my queries? E.g.

	Connection con = ds.getConnection();
	Statement s = con.createStatement();
	s.execute("alter session set NLS_DATE_FORMAT = 'YYYY-MM-DD
HH24:MI:SS'");
	...
	s.close();
	con.close();

Or can this be passed to the DBCP connection engine somehow so that 
when a new connection is established the correct date format is set? This 
problem has come about since the introduction of
'timeBetweenEvictionRunsMillis'
into the DB ResourceParams section within server.xml.

I'd rather this was done than have to intersperce 'to_date' calls everywhere
;(

Thanks,

Mark

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Mime
View raw message