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

Popular posts from this blog

c++ - QTextObjectInterface with Qml TextEdit (QQuickTextEdit) -

javascript - angular ng-required radio button not toggling required off in firefox 33, OK in chrome -

xcode - Swift Playground - Files are not readable -