Jdbc-initialize-database cannot find script files - DataAccessResourceFailureException

I cannot get my Spring web application to find my scripts. I have a jdbc namespace configured. I have scripts, but I can’t understand why, no matter where I put the scripts, I cannot find them. I specifically noted that folders are "class folders." I put them in the same folder as all my cans ... I threw a hundred stones. It is almost as if the error indicated was not my error.

It should be so simple, but sometimes I just hit the stumps.

Ultimately, I try to get the code in place, so I can initialize the database that I promoted to CloudFoundry.

I get "Can't read the SQL script from the resource path to the course [etcog-schema.sql]." This is my code - just like all the other examples I found.

<jdbc:initialize-database data-source="dataSource">
  <jdbc:script location="classpath:etcog-schema.sql"/>
  <jdbc:script location="classpath:etcog-data.sql"/>
</jdbc:initialize-database>

Thank.

+5
source share
1 answer

If you use STS, and if you created the application using Spring templates, then if you just put your * .sql files inside src / main / resources , you should have access to them via classpath: ...

+5
source

All Articles