These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: ALTER SESSION SET NLS_LANGUAGE = French
PostPosted: Mon Dec 12, 2005 11:46 am 
Newbie

Joined: Mon Dec 12, 2005 11:32 am
Posts: 1
1.0
hibernate.xml:

I am using hibernate with Oracle 9.1. I would like to alter the session language wich could be done in oracle using the following Query: ALTER SESSION SET NLS_LANGUAGE = French. Could you help me to execute this statement every time a session is created?

Thank you

J'utilise hibernate avec Oracle 9.1. J'aimerais bien changer la langue pendant la session. Ceci se fait en utilisant ALTER SESSION SET NLS_LANGUAGE = French. Avez-vous une idée comment exeuter cette commande à chaque fois une session est crée?

Merci


Top
 Profile  
 
 Post subject: Re: ALTER SESSION SET NLS_LANGUAGE = French
PostPosted: Sat Oct 28, 2006 1:20 am 
Newbie

Joined: Fri Oct 27, 2006 8:04 pm
Posts: 1
Try this (http://www.hibernate.org/118.html#A26), works for me:

Code:
Session session = HibernateSessionFactory.getInstance().getCurrentSession();
    try {
        tx = session.beginTransaction();
        PreparedStatement ps = session.connection().prepareStatement("alter session set nls_languague=French");
        ps.execute();
           
        classList = session.createQuery("from ... where ...").setCacheable(true).list();
        ...
    } catch (HibernateException he) {
        he.printStackTrace();
    } catch (java.sql.SQLException sqle) {
        sqle.printStackTrace();
    }

- Josue


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.