-->
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.  [ 1 post ] 
Author Message
 Post subject: How do we specify the DB2/400 schema name in HQL dynamically
PostPosted: Fri Apr 14, 2006 11:23 am 
Newbie

Joined: Fri Apr 14, 2006 11:03 am
Posts: 6
Hi,

We are using the database DB2/400 on OS/400 V5R4, IBM Iseries
Our Schema stucture and application structure is ofcourse tightly coupled as it is a legacy database.

Each user of the application has a specific schema/library specified.
All the DB operations performed/executed by that user should only effect in the specified schema.

We are planning to implement DB persistance using Hibernate3 and we are mandated to follow the same principle of specifying the schema for every user.

Perviously we used to build SQL statments dynamically as following.

String sql = "SELECT * FROM " + library + ".VENDORS";

where the library is a HTTPSession attribute maintained for every user when the user logs in.

I have gone through the documentation and some books on Hibernate regarding the Schema/Library. In that I could only find ways to mention the schema statically in mapping files using the schema attribute in the class entity. This will not cater our specific need on this issue.

I am looking for a way to dynamically mention the schema for a particular Hibernate session, by which I can make sure that all the DB operations are done on that schema objects.

Can anyone please help me out, by suggesting the right way and if not any work arounds on this issue.

Appreciate any help!!!

Thanks & Regards

_________________
Phaneendra Kumar Simhadri
Senior Web Developer


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

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.