In this lesson we will show how to delete rows from the underlying database using the hibernate. Lets first write a java class to delete a row from the database.
Create a java class:
Here is the code of our java file (
which we will delete a row from the insurance table using the query
"delete from Insurance insurance where id = 2"
Here is the code of delete query:
|log4j:WARN No appenders
could be found for logger (org.hibernate.cfg.Environment).
log4j:WARN Please initialize the log4j system properly.
Hibernate: delete from insurance where ID=2
Deleted Row: 1
Rs. 20,000 US$ 300
Today: Rs. 10,000 US$150
Course Duration: 30 hrs
Posted on: July 30, 2007 If you enjoyed this post then why not add us on Google+? Add us to your Circles