本文介绍了jdbc-initialize-database找不到脚本文件-DataAccessResourceFailureException的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法通过Spring网络应用找到我的脚本。我配置了jdbc命名空间。我已经写了脚本,但是我无法弄清楚为什么无论放在哪里脚本都找不到。我专门将文件夹标记为类文件夹。我把它们和我所有的罐子放在同一个文件夹中……我扔了一百块石头。

I cannot get my Spring web app to find my scripts. I have the jdbc namespace configured. I have the scripts written, but, I can't figure out why no matter where I put the scripts, they can't be found. I've specifically marked folders are 'class folders'. I've put them in the same folderr as all my jars... I've thrown a hundred rocks. It's almost as though the error listed is not really my error.

这应该很简单,但有时我只是碰到了树桩。

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

最终,我正在尝试获取代码,以便初始化已升级到CloudFoundry的数据库。

Ultimately, I'm trying to get code in place so I can initialize a database I've promoted to CloudFoundry.

我得到无法从类路径资源[etcog-schema.sql]中读取SQL脚本。这是我的代码-就像我找到的其他所有示例一样。

I get "Cannot read SQL script from class path resource [etcog-schema.sql]". This is my code--just like every other example I've found.

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

谢谢。

推荐答案

如果您使用的是STS,并且已使用Spring模板创建了应用程序,则只需将* .sql文件放入 src / main / resources ,您应该可以通过classpath访问它们:...

If you are using STS and if you have created your application using the Spring Templates, then if you just put your *.sql file(s) inside src/main/resources, you should be able to access them via classpath:...

这篇关于jdbc-initialize-database找不到脚本文件-DataAccessResourceFailureException的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-15 05:35