< Prev
Next >



Executing SQL Queries using Hibernate



So far, you have seen how to execute commands in Hibernate Query Language (HQL) which are slightly different from SQL commands. For those who are somehow uncomfortable with learning Hibernate Query Language to interact with the database, don't worry, Hibernate has got a solution. Hibernate also provides a way to execute the SQL queries by using its method createNativeQuery() of Query class.


Today, we are going to show you how to execute the SQL commands like accessing multiple columns of a table and executing SQL methods like max(), min(), sum(), count() and avg() using Hibernate.




Note :


Please subscribe our social media channels for notifications, we post a new article everyday.

Decodejava Google+ Page Decodejava Facebook Page  DecodeJava Twitter Page

Coming Next
-
Python

Ad2