[英]spring batch run sql script as a tasklet
Does spring batch support executing a sql scripts as part of a tasklet? Spring Batch是否支持将SQL脚本作为Tasklet的一部分执行? Below are the sequence of steps that I'm planning to develop with spring batch. 以下是我计划使用Spring Batch开发的步骤序列。
For step 2 and 4 I need to run bunch of sql statements in sequence. 对于步骤2和4,我需要按顺序运行一堆sql语句。 How can I accomplish running a sql script? 如何完成运行SQL脚本?
While I don't believe Spring Batch specifically supports what you're asking for, you could take a look at ScriptUtils to see if it provides the behavior you're looking for. 虽然我不认为Spring Batch特别支持您的要求,但是您可以查看ScriptUtils来查看它是否提供了您想要的行为。
If not, depending on the complexity of your SQL there is the option of using JdbcTemplate
directly within a Tasklet
and creating a series of Tasklets
如果不是,则根据您的SQL的复杂性,可以选择直接在Tasklet
中使用JdbcTemplate
并创建一系列Tasklets
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.