java - How to run SQL script using hibernate -
i have requirement load , run sql-script (reportdata_pr.sql) create procedures on start-up , run procedures.
we using spring 4.0.2.release , hibernate 4.3.5.final development.
is possible run script file using hibernate. if yes how that. if not there other work around achieve goal.
thanks
you can run script using nativequery:
e.g.
entitymanager manager = getentitymanager(); query q = manager.createnativequery("begin"+sqlscript+"end;"); q.executeupdate();
see if helps
Comments
Post a Comment