This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
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


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
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.
 
 
subject: Alter session to set NLS_CALENDAR = 'Persian'
 
Similar Threads
SCJP: playing with inheritance and when what calls what.
supporting right to left align,viceversa left to right align in 1 jsp in struts internationalization
Cleared SCJP with 90%
Happy Norooz (New Year) at JavaRanch
Reading date from Oracle based on calendar