Announcement Announcement Module
No announcement yet.
csv file processing with spring batch to insert into DB Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • csv file processing with spring batch to insert into DB


    My requirement is like ..

    taking the csv file data and insert into Data base.using hibernate and spring batch

    but my csv file data is not consistent.that means some columns may be empty.for example ..if there are total 11 columns are there ,while processing the row in file some times i will pass only 8 columns.. some times that to deal with this type of requirement.

    the exception I am getting is

    org.springframework.batch.item.file.FlatFileParseE xception: Parsing error at line: 1, input=[DICTIONARY,22104,ANTIQUE PAPER,LOGICAL DUPLICATE,Duplicate,EN_ZZ,,,] at org.springframework.batch.item.file.mapping.Defaul tLineMapper.mapLine( at org.springframework.batch.item.file.FlatFileItemRe ader.doRead( at at org.springframework.batch.core.step.item.SimpleChu nkProvider.doRead( at org.springframework.batch.core.step.item.SimpleChu at org.springframework.batch.core.step.item.SimpleChu nkProvider$1.doInIteration(SimpleChunkProvider.jav a:106) at plate.getNextResult( at plate.executeInternal( at plate.iterate( at org.springframework.batch.core.step.item.SimpleChu nkProvider.provide( at org.springframework.batch.core.step.item.ChunkOrie ntedTasklet.execute( at org.springframework.batch.core.step.tasklet.Taskle tStep$ChunkTransactionCallback.doInTransaction(Tas at nTemplate.execute( at org.springframework.batch.core.step.tasklet.Taskle tStep$2.doInChunkContext( at org.springframework.batch.core.scope.context.StepC ontextRepeatCallback.doInIteration(StepContextRepe at plate.getNextResult( at plate.executeInternal( at plate.iterate( at org.springframework.batch.core.step.tasklet.Taskle tStep.doExecute( at org.springframework.batch.core.step.AbstractStep.e xecute( at org.springframework.batch.core.job.SimpleStepHandl er.handleStep( at org.springframework.batch.core.job.flow.JobFlowExe cutor.executeStep( at ate.StepState.handle(Step

  • #2
    The tokenizer and.or the field set mapper probably has a "strict" property that you can set?