wood burning stoves 2.0*
The moose likes Object Relational Mapping and the fly likes Alter session to set NLS_CALENDAR = 'Persian' Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Alter session to set NLS_CALENDAR = Watch "Alter session to set NLS_CALENDAR = New topic
Author

Alter session to set NLS_CALENDAR = 'Persian'

Vijeth Konanavar Bhadrappa
Greenhorn

Joined: Jun 09, 2008
Posts: 14
Hi, I am new to this Hibernates/Springs. In my application, I have to use date according to Persian calendar. So is there anyway to set this at the time of Connection pooling or is any way to set this globally for whole application?
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper

Joined: Aug 26, 2006
Posts: 4968
    
    1

Howdy Greenhorn!

Hmmm...

Are you setting this for the application for the database, the connection, the application, or what?

-Cameron McKenzie
Vijeth Konanavar Bhadrappa
Greenhorn

Joined: Jun 09, 2008
Posts: 14
Hmm fine.. McKenzie, I want that to be applied for every Database operation which application executes.

Earlier i had developed the same application in EJB. When i get a connection from connection pool, i will execute the alter session query using that connection, and execute all database operations using the same connection object.

But in this Springs/Hibernate, we will take a session object from session factory and use that session object for all transactions done on Database. As per my understanding, while creating connection pool, in-turn this session factory, there should be some way to alter the session properties like NLS_CALENDAR.


Am i correct? Please correct me if i am wrong.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Alter session to set NLS_CALENDAR = 'Persian'