Spring Batch Framework-自动创建批处理表 [英] Spring Batch Framework - Auto create Batch Table

查看:458
本文介绍了Spring Batch Framework-自动创建批处理表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚使用Spring Batch框架创建了一个批处理作业,但是我没有运行CREATE SQL的数据库特权.当我尝试运行批处理作业时,在框架尝试创建TABLE_BATCH_INSTANCE时遇到错误.我尝试禁用

I just created a batch job using Spring Batch framework, but I don't have Database privileges to run CREATE SQL. When I try to run the batch job I hit the error while the framework tried to create TABLE_BATCH_INSTANCE. I try to disable the

<jdbc:initialize-database data-source="dataSource" enabled="false">    
 ...
</jdbc:initialize-database>

但是在尝试之后,我仍然遇到错误

But after I tried I still hit the error

org.springframework.jdbc.BadSqlGrammarException: PreparedStatementCallback; bad SQL grammar [SELECT JOB_INSTANCE_ID, JOB_NAME from BATCH_JOB_INSTANCE where JOB_NAME = ? and JOB_KEY = ?]; nested exception is java.sql.SQLSyntaxErrorException: ORA-00942: table or view does not exist

任何人都可以禁用SQL,我只想测试我的读写器和处理器是否正常工作.

Anyway can disable the SQL, I just want to test my reader writer and processor work properly.

推荐答案

Spring Batch使用数据库保存元数据以实现其恢复/重试功能.

Spring Batch uses the database to save metadata for its recover/retry functionality.

如果您无法在数据库中创建表,则您必须禁用这种行为

If you can't create tables in the database then you have to disable this behaviour

如果可以创建批处理元数据表,但不能在运行时创建,则可以

If you can create the batch metadata tables but not in runtime then you might create them manually

这篇关于Spring Batch Framework-自动创建批处理表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆