Created
April 30, 2019 06:57
-
-
Save Edijun/15f7048c429d1b7138173c3e5d50f1fe to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @Bean | |
| public JdbcBatchItemWriter<Product> csvProductWriter() { | |
| JdbcBatchItemWriter<Product> csvProductWriter = new JdbcBatchItemWriter<Product>(); | |
| csvProductWriter.setItemSqlParameterSourceProvider(new BeanPropertyItemSqlParameterSourceProvider<Product>()); | |
| csvProductWriter.setSql("INSERT INTO product (id, name, price, description) VALUES (:id, :name, :price, :description)"); | |
| csvProductWriter.setDataSource(dataSource); | |
| return csvProductWriter; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment