I'm using createSQLQuery
with setString
(No hard coded value) in Hibernate. I want to know that is Hibernate uses PreparedStatement
for createSQLQuery
?
Concern:
I want to preserve the execution plan created by this query in cache so next time same query fired on database, It would use same execution plan.
FYI: I'm using MSSQL Server 2008
/* This is just example I'm not using same query */
Query nativeSQLQuery = session.createSQLQuery("select Firstname from user_master where user_name = :param");
nativeSQLQuery.setString("param", "vicky.thakor");
I couldn't find stackoverflow link or even in google so please provide me link if any.