You want the user forum: http://forum.hibernate.org/

 

 


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Srinivas Jadcharla
Sent: Friday, January 20, 2006 3:20 PM
To: hibernate-devel@lists.sourceforge.net
Subject: [Hibernate] bind variables Question

 

Hi there,

We are developing a hibernate(2.1.X) based application.We got a message from our DBA to use bind variables, not literals.What exactly that means.Here is my code ..What exactly i should do to use bind variables?

  try {
   Session session = HibernateSessionFactory.currentSession();
   StringBuffer sql = new StringBuffer();
   sql.append("from CswCaseParent1 as cp where (cp.clientSsnId = '").append(ssn)
     .append("' AND cp.clientPinId = '").append(pin)
     .append("') OR (cp.respondentSsnId = '").append(ssn)
     .append("' AND cp.respondentPinId ='").append(pin).append("')");
   Query q1 = session.createQuery (sql.toString());
   result = q1.list();

  }

Any help is much appreciated.
--
Thanks & Regards
Srinivas
732-648-9421(Cell)

Reply via email to