File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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

Alter session to set NLS_CALENDAR = 'Persian'

Vijeth Konanavar Bhadrappa

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

Howdy Greenhorn!


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

-Cameron McKenzie
Vijeth Konanavar Bhadrappa

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:
subject: Alter session to set NLS_CALENDAR = 'Persian'
It's not a secret anymore!