How to insert default data into table using import.sql file in Hibernate, MySQL Application

后端 未结 1 1309
不思量自难忘°
不思量自难忘° 2020-12-20 21:21

I am developing an application using Spring MVC (version 3.1), Hibernate (Version 3.5) and MySQL. In this application, I am creating a database schema each time when the app

1条回答
  •  隐瞒了意图╮
    2020-12-20 21:47

    Spring must know where to find your file.

    If you are using maven, there are several way of doing so.

    you can use classpath:/import.sql and put your file in src/test/resources or src/main/resources, depending if you need this for test only or not.

    0 讨论(0)
提交回复
热议问题