I have a SQL script with database dump. How can I execute it using Hibernate's EntityManager
?
I tried it this way:
EntityManager manager = getEntityManager();
Query q = manager.createNativeQuery(sqlScript);
q.executeUpdate();
but it works only when sqlScript
contains a single SQL query, while I need to run multiple inserts and other complex stuff.
RDBMS:
Oracle Database 11g Express Edition Release 11.2.0.2.0 - 64bit Production
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…