I have used hibernate to interact with my database, now I wanted to make my database layer secure against SQL Injection, so I did some research and I found out that my queries should be parameterized , so does it mean if I just structure my HQL queries as:
List mothers = session.createQuery(
"select mother from Cat as cat join cat.mother as mother where cat.name = ?")
.setString(0, name)
.list();
Then it's parameterized and protected from SQL Injection, or is there something else which I need to do...
One other thing was mentioned - "Always escape your Data" How can that be achieved ??