|
From: Juergen H. <ju...@in...> - 2005-03-24 07:41:38
|
Does anyone have experiences with date formats on Oracle, in particular with specifying the format on the client side (using the thin driver, not the OCI driver)? See the following (still unanswered) post on the Hibernate forums: http://forum.hibernate.org/viewtopic.php?t=940117 The application that Jens is referring to there is Spring-based, BTW. Juergen |
|
From: Alexandru P. <the...@ez...> - 2005-03-24 08:02:19
|
[quote Juergen Hoeller::on 3/24/2005 9:41 AM] > Does anyone have experiences with date formats on Oracle, in particular with > specifying the format on the client side (using the thin driver, not the OCI > driver)? > > See the following (still unanswered) post on the Hibernate forums: > > http://forum.hibernate.org/viewtopic.php?t=940117 > > The application that Jens is referring to there is Spring-based, BTW. > > Juergen > > > > ------------------------------------------------------- > This SF.net email is sponsored by Microsoft Mobile & Embedded DevCon 2005 > Attend MEDC 2005 May 9-12 in Vegas. Learn more about the latest Windows > Embedded(r) & Windows Mobile(tm) platforms, applications & content. Register > by 3/29 & save $300 http://ads.osdn.com/?ad_id=6883&alloc_id=15149&op=click > _______________________________________________ > Springframework-developer mailing list > Spr...@li... > https://lists.sourceforge.net/lists/listinfo/springframework-developer > > Juergen in my Oracle driver bookmarks folder i have the following links: 1/ http://www.oracle.com/technology/software/tech/java/sqlj_jdbc/htdocs/winsoft.html (there is a reference to nls.zip download) 2/ http://www.oracle.com/technology/software/tech/java/sqlj_jdbc/files/jdbcreadme.html 3/ http://www.csee.umbc.edu/help/oracle8/java.815/a64685/advanc1.htm Pls let me know if any of them helped you. -- :alex |.::the_mindstorm::.| |
|
From: Thomas R. <tho...@tr...> - 2005-03-24 13:34:26
|
If you can't set it on the driver level then an AOP proxy or a DataSource wrapper class could intercept the getConnectiona and issue an "alter session set nls_date_format = 'YYYY-MM-DD HH24:MI:SS'" statement before the connection is handed out. Thomas On Mar 24, 2005, at 2:41 AM, Juergen Hoeller wrote: > Does anyone have experiences with date formats on Oracle, in > particular with > specifying the format on the client side (using the thin driver, not > the OCI > driver)? > > See the following (still unanswered) post on the Hibernate forums: > > http://forum.hibernate.org/viewtopic.php?t=940117 > > The application that Jens is referring to there is Spring-based, BTW. > > Juergen > > > > ------------------------------------------------------- > This SF.net email is sponsored by Microsoft Mobile & Embedded DevCon > 2005 > Attend MEDC 2005 May 9-12 in Vegas. Learn more about the latest Windows > Embedded(r) & Windows Mobile(tm) platforms, applications & content. > Register > by 3/29 & save $300 > http://ads.osdn.com/?ad_id=6883&alloc_id=15149&op=click > _______________________________________________ > Springframework-developer mailing list > Spr...@li... > https://lists.sourceforge.net/lists/listinfo/springframework-developer > > |
|
From: Juergen H. <ju...@in...> - 2005-03-24 13:58:44
|
Hmm, so essentially that SQL needs to be executed for each created Connection on that client. That piece of information already helps, thanks :-) The problem with a Connection wrapper in front of the connection pool is that we'd execute that SQL statement too often: essentially, every time a Connection is fetched from the pool. It should be sufficient to execute that SQL statement every time the pool internally creates a Connection, but that means that the pool itself has to support such special initialization of its Connections. JBoss and WebLogic both support such initializing SQL statements for Connections: in JBoss, it's the <new-connection-sql> tag in "-ds.xml" files; in WebLogic, the "Init SQL" field in the "Advanced Options" section of the connection pool configuration in the administration console. However, Jens (the guy who originally asked that question) is using C3P0 on Tomcat. And C3P0 doesn't seem to support such init SQL, and neither does Commons DBCP. So I wonder what the best approach is in such a scenario... Juergen -----Original Message----- From: spr...@li... [mailto:spr...@li...]On Behalf Of Thomas Risberg Sent: Thursday, March 24, 2005 2:34 PM To: spr...@li... Subject: Re: [Springframework-developer] Date formats on Oracle If you can't set it on the driver level then an AOP proxy or a DataSource wrapper class could intercept the getConnectiona and issue an "alter session set nls_date_format = 'YYYY-MM-DD HH24:MI:SS'" statement before the connection is handed out. Thomas On Mar 24, 2005, at 2:41 AM, Juergen Hoeller wrote: > Does anyone have experiences with date formats on Oracle, in > particular with > specifying the format on the client side (using the thin driver, not > the OCI > driver)? > > See the following (still unanswered) post on the Hibernate forums: > > http://forum.hibernate.org/viewtopic.php?t=940117 > > The application that Jens is referring to there is Spring-based, BTW. > > Juergen > > > > ------------------------------------------------------- > This SF.net email is sponsored by Microsoft Mobile & Embedded DevCon > 2005 > Attend MEDC 2005 May 9-12 in Vegas. Learn more about the latest Windows > Embedded(r) & Windows Mobile(tm) platforms, applications & content. > Register > by 3/29 & save $300 > http://ads.osdn.com/?ad_id=6883&alloc_id=15149&op=click > _______________________________________________ > Springframework-developer mailing list > Spr...@li... > https://lists.sourceforge.net/lists/listinfo/springframework-developer > > ------------------------------------------------------- This SF.net email is sponsored by Microsoft Mobile & Embedded DevCon 2005 Attend MEDC 2005 May 9-12 in Vegas. Learn more about the latest Windows Embedded(r) & Windows Mobile(tm) platforms, applications & content. Register by 3/29 & save $300 http://ads.osdn.com/?ad_id=6883&alloc_id=15149&op=click _______________________________________________ Springframework-developer mailing list Spr...@li... https://lists.sourceforge.net/lists/listinfo/springframework-developer |
|
From: <tho...@tr...> - 2005-03-24 15:05:36
|
This quote is from the Oracle JDBC Manual (Oracle9i JDBC Developer's Guide and Reference, Release 2 (9.2), Part Number A96654-01) "The Thin driver obtains language and territory settings (NLS_LANGUAGE and NLS_TERRITORY) from the Java locale in the JVM user.language property. The date format (NLS_DATE_FORMAT) is set according to the territory setting." So if you fudge the territory setting, then the date might be set according to the required format. Other than that - a login trigger would have been fine if the database was more current :). I'm not sure what the overhead of the "alter session" is - does it even generate a roundtrip to the server? Thomas Quoting Juergen Hoeller <ju...@in...>: > Hmm, so essentially that SQL needs to be executed for each created > Connection on that client. That piece of information already helps, thanks > :-) > > The problem with a Connection wrapper in front of the connection pool is > that we'd execute that SQL statement too often: essentially, every time a > Connection is fetched from the pool. It should be sufficient to execute that > SQL statement every time the pool internally creates a Connection, but that > means that the pool itself has to support such special initialization of its > Connections. > > JBoss and WebLogic both support such initializing SQL statements for > Connections: in JBoss, it's the <new-connection-sql> tag in "-ds.xml" files; > in WebLogic, the "Init SQL" field in the "Advanced Options" section of the > connection pool configuration in the administration console. > > However, Jens (the guy who originally asked that question) is using C3P0 on > Tomcat. And C3P0 doesn't seem to support such init SQL, and neither does > Commons DBCP. So I wonder what the best approach is in such a scenario... > > Juergen > > > -----Original Message----- > From: spr...@li... > [mailto:spr...@li...]On Behalf > Of Thomas Risberg > Sent: Thursday, March 24, 2005 2:34 PM > To: spr...@li... > Subject: Re: [Springframework-developer] Date formats on Oracle > > > If you can't set it on the driver level then an AOP proxy or a > DataSource wrapper class could intercept the getConnectiona and issue > an "alter session set nls_date_format = 'YYYY-MM-DD HH24:MI:SS'" > statement before the connection is handed out. > > Thomas > > On Mar 24, 2005, at 2:41 AM, Juergen Hoeller wrote: > > > Does anyone have experiences with date formats on Oracle, in > > particular with > > specifying the format on the client side (using the thin driver, not > > the OCI > > driver)? > > > > See the following (still unanswered) post on the Hibernate forums: > > > > http://forum.hibernate.org/viewtopic.php?t=940117 > > > > The application that Jens is referring to there is Spring-based, BTW. > > > > Juergen > > > > > > > > ------------------------------------------------------- > > This SF.net email is sponsored by Microsoft Mobile & Embedded DevCon > > 2005 > > Attend MEDC 2005 May 9-12 in Vegas. Learn more about the latest Windows > > Embedded(r) & Windows Mobile(tm) platforms, applications & content. > > Register > > by 3/29 & save $300 > > http://ads.osdn.com/?ad_id=6883&alloc_id=15149&op=click > > _______________________________________________ > > Springframework-developer mailing list > > Spr...@li... > > https://lists.sourceforge.net/lists/listinfo/springframework-developer > > > > > > > > ------------------------------------------------------- > This SF.net email is sponsored by Microsoft Mobile & Embedded DevCon 2005 > Attend MEDC 2005 May 9-12 in Vegas. Learn more about the latest Windows > Embedded(r) & Windows Mobile(tm) platforms, applications & content. > Register > by 3/29 & save $300 http://ads.osdn.com/?ad_id=6883&alloc_id=15149&op=click > _______________________________________________ > Springframework-developer mailing list > Spr...@li... > https://lists.sourceforge.net/lists/listinfo/springframework-developer > > > > ------------------------------------------------------- > This SF.net email is sponsored by Microsoft Mobile & Embedded DevCon 2005 > Attend MEDC 2005 May 9-12 in Vegas. Learn more about the latest Windows > Embedded(r) & Windows Mobile(tm) platforms, applications & content. Register > by 3/29 & save $300 http://ads.osdn.com/?ad_id=6883&alloc_id=15149&op=click > _______________________________________________ > Springframework-developer mailing list > Spr...@li... > https://lists.sourceforge.net/lists/listinfo/springframework-developer > |