There’s an error on using Spring batch JdbcBatchItemWriter.
insert into books(order_id, order_no, paid_payment_id) values (:orderId, :orderNo, :paidPaymentId)
private JdbcBatchItemWriter<BooksEntity> booksWriter() {
return new JdbcBatchItemWriterBuilder<BooksEntity>()
.itemSqlParameterSourceProvider(new BeanPropertyItemSqlParameterSourceProvider<>())
.dataSource(dataSource)
.sql(
"insert into books(order_id, order_no, paid_at, paid_payment_id, pay_method, pay_no, pg, service_type, status, transaction_amount, transaction_at, vat_amount, canceled_at, created_at) "
+ " values (:expectedCalculationAmount, :feeAmount, :orderId, :orderNo, :paidAt, :paidPaymentId, :payMethod, :payNo, pg, :serviceType, :status, :transactionAmount, :transactionAt, :vatAmount, :canceledAt, :createdAt)")
CalculationOriginalAccountBooksItemPreparedStatementSetter())
.build();
}
spring:
datasource:
url: jdbc:mysql://localhost:3306/book?useSSL=false&useUnicode=true&serverTimezone=Asia/Seoul
password: root
username: root
driver-class-name: com.mysql.cj.jdbc.Driver
jpa:
open-in-view: false
hibernate:
ddl-auto: update
S1009 Error I don’t know what that means.
Please help me.
2
Answers
One thing I can notice right away is that you have used
pg
in the values instead of:pg
which would get replaced during the query formation.