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.  [ 3 posts ] 
Author Message
 Post subject: How to execute Procedures in NH 1.2.0 bate 1
PostPosted: Sun Oct 08, 2006 5:11 am 
Newbie

Joined: Wed Sep 20, 2006 8:47 pm
Posts: 5
Hibernate version: 1.2.0

in 1.0.2.0 i used this execute procedures:
ISessionFactoryImplementor sfi = (ISessionFactoryImplementor)EntityDB.Factory;
IDbCommand dbCmd = sfi.ConnectionProvider.Driver.CreateCommand();
dbCmd.CommandText = spName;
dbCmd.CommandType = CommandType.StoredProcedure;

but in 1.2.0 IDriver have not CreateCommand() method, i will how to execute procedure.

thanks!


Top
 Profile  
 
 Post subject:
PostPosted: Sun Oct 08, 2006 8:32 am 
Contributor
Contributor

Joined: Wed May 11, 2005 4:59 pm
Posts: 1766
Location: Prague, Czech Republic
Use ISession.Connection.CreateCommand. Or use methods of sfi.ConnectinoProvider. IDriver is a semi-internal interface (as well as ISessionFactoryImplementor, by the way) and it wasn't supposed to be used from outside NHibernate.


Top
 Profile  
 
 Post subject: Thanks!
PostPosted: Sun Oct 08, 2006 9:12 pm 
Newbie

Joined: Wed Sep 20, 2006 8:47 pm
Posts: 5
Thanks for you reply.

i can use session.CreateSQLQuery("Select sysdate from dual").AddScalar("sysdate", NHibernateUtil.DateTime).List(),get the Oracle sysdate, I don't know if i want to execute proc used this,how can i do.

thanks!


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.