
您需要在中具有
jdbc/fileUploadDS名称的资源引用
web.xml。并确保在安装过程中或通过
ibm-web-bnd.xml文件将其绑定到实际的数据源名称。
中的定义
web.xml:
<resource-ref> <description /> <res-ref-name>jdbc/fileUploadDS</res-ref-name> <res-type>javax.sql.DataSource</res-type> <res-auth>Container</res-auth> <res-sharing-scope>Shareable</res-sharing-scope></resource-ref>
如果您不想使用
web.xml,那么在普通的Java EE应用程序中,您可以在Web组件(Servlet,过滤器)中添加以下类注释:
@Resource(name="jdbc/fileUploadDS", type=javax.sql.DataSource.class, lookup="jdbc/fileUploadDS")
但我不是Spring-boot专家,所以不知道它是否可行或是否可行。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)