java - createSQLQuery in hibernate uses Prepared Statement? -
I createSQLQuery
and setString
(no hard-coded values) I'm using) in Hibernate I want to know that Hibernate has to be used in created condition
for createSQLQuery
?
Concern:
I want to preserve the execution plan created by this query in the cache, so the next query will be sent to the database next time Given, it will use the same execution plan.
FYI: I'm using MSSQL Server 2008
/ * This is just an example I'm not using the same question Am * / Query nativeSQLQuery = session.createSQLQuery ("user_master before name select where user_name =: param"); NativeSQLQuery.setString ("Ultimate", "vicky.thakor");
I can not even get in the Stackworflow link or Google, please provide me a link.
I've tried to use Skyuelacli method for making hibernates to a query, then I will the exceptions below: -
on sqlQueryDirect com.mysql.jdbc.ConnectionImpl.execSQL (ConnectionImpl.java:2568) on com.mysql.jdbc.MysqlIO (MysqlIO.java:2113) on com.mysql.jdbc.PreparedStatement.executeInternal (PreparedStatement.java:2113) on com.mysql.jdbc.PreparedStatement on .executeQuery org.hibernate.jdbc.AbstractBatcher.getResultSet (PreparedStatement.java:2275) (AbstractBatcher.java:186 ) At org.hibernate.loader.Loader.getResultSet (Loader.java:1787) at org.hibernate.loader. On Loader.doQuery org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections (Loader.java:674) (Loader.java:236) on org.hibernate.loader.Loader.doList (Loader.java:2220)
as we can see from the above with the exception that it will try to pre-ecute com.mysql.jdbc.PreparedStatement.executeQuery (PreparedStatement.java:2275) internally.
Even where Alex has received a question from @AlexSerana on the exception of trying to change the option of the table.
I think the Hibernate uses the space prepared for internally for HibernateS SQLX .