4 Replies Latest reply on Jan 18, 2017 6:10 PM by Cheng Fang

    Import from xlsx file

    Sławomir Wojciechowski Newbie

      Hello,

       

       

      I build jbatch process that should import data from xlsx file to databases. It's my jbatch file:

       

       

      <job id="main" version="1.0" xmlns="http://xmlns.jcp.org/xml/ns/javaee">  

            <step id="pobierzDane">

                  <properties>

                  <property name="javax.transaction.global.timeout" value="1800" />

              </properties>            

                  <chunk>

                        <reader ref="excelUserModelItemReader">

                      <properties>

                          <property name="resource" value="#{jobParameters['sciezka']}#{jobParameters['nazwaPliku']}"/>

                          <property name="beanType" value="java.util.List"/>

                          <property name="sheetName" value="FCT"/>

                          <property name="start" value="1"/>

                          <property name="headerRow" value="0"/>

                          <property name="mapperFeatures" value="AUTO_DETECT_FIELDS=false"></property>

       

                          <!-- need to ignore unknown properties as some additional properties in data -->

                          <property name="deserializationFeatures" value="FAIL_ON_UNKNOWN_PROPERTIES=false"/>

                      </properties>

                  </reader>

                        <processor ref="myItemProcessor">

                              <properties>

                                    <property name="nazwaPliku" value="#{jobParameters['nazwaPliku']}" />

                              </properties>

                        </processor>

                        <writer ref="jdbcItemWriter">

                      <properties>

                          <property name="dataSourceLookup" value="java:/fmsFms" />

                      <property name="sql" value="insert into schema.t_my_tab(name, data, number, id) values(?, ?, ?, '1')" />

                          <property name="beanType" value="java.util.List" />

                      </properties>

                  </writer>

                  </chunk>

            </step>

      </job>

       

       

      The problem is, becouse third column in excel sheet contain big numbers like 567894354. This values are imported to jbatch in format like 5.67894+e008. I see this values in processor and datas in this format are loaded to database. How to solve this problem, how to receive in jbatch program "clear" numer value?