我正在努力通过Datanucleus将一些数据输入Mongodb。
这是我使用的数据的一部分。
STD_YM|BLOCK_CD|BZ_SCLS_CD|BZ_LOBZ_SCLS_NM|M10_APV_CNT|M20_APV_CNT|M30_APV_CNT|M40_APV_CNT|M50_APV_CNT|M60_APV_CNT|W10_APV_CNT|W20_APV_CNT|W30_APV_CNT|W40_APV_CNT|W50_APV_CNT|W60_APV_CNT|M10_SALE_AMT|M20_SALE_AMT|M30_SALE_AMT|M40_SALE_AMT|M50_SALE_AMT|M60_SALE_AMT|W10_SALE_AMT|W20_SALE_AMT|W30_SALE_AMT|W40_SALE_AMT|W50_SALE_AMT|W60_SALE_AMT
201303|11220600300011000001|307009|������|0|8205|31102|23541|11972|6869|0|2863|12005|8553|5875|2022|0|464743912.58|2068701224.98|1802065918.66|933525067.07|502156752.49|0|156241028.98|759822379.88|604698640.27|412770581.02|148236607.2
201303|11230640300021000001|307001|ȭ��ǰ|0|1488|2308|1336|1437|168|28|9737|4614|2423|1503|249|0|23547325.77|43333197.38|18429589.09|25254914.78|3146259.88|436685.97|134084889.79|71525545.96|43535225.85|26759523.59|6475514.59
201303|31130140204001000001|410004|��ö��|0|0|40|100|40|40|0|0|0|60|20|0|0|0|1109420.55|2357518.72|554710.28|1030176.23|0|0|0|931120.83|158488.65|0
201303|11240580100101000004|414002|����Ŀ��|0|304|1843|494|171|38|0|646|855|323|114|38|0|8101568.28|51174650.98|12994670.42|4424084.16|1244333.5|0|11491898.46|22623897.36|6870635.31|1506600.73|1244333.5
201303|11230640200081000005|204001|����|0|1311|1221|374|154|33|0|176|55|44|0|33|0|64411996.88|66785690.31|23915179.14|8912210.94|2127286.51|0|11812038.37|2194464|2071305.31|0|2239248.98
201303|11230640200081000002|409009|��������|0|228|654|175|99|33|0|143|286|66|22|0|0|2440404.98|9782980.19|2435064.92|1025290.5|336423.45|0|1836978.8|3903579.97|1132091.6|411184.22|0
这是我制作的两个pojo课程。
POJO 1. SALE_AGE
package org.datanucleus.samples.jdo.tutorial;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.PrimaryKey;
import javax.jdo.annotations.Serialized;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
/**
* Created by Sungjin on 2016-03-15.
*/
@PersistenceCapable
public class SALE_AGE {
@PrimaryKey
@GeneratedValue(strategy = GenerationType.IDENTITY)
private String Date;
private String District_code;
private String Business_code;
private String Business_name;
private double M10_APV_CNT;
private double M20_APV_CNT;
private double M30_APV_CNT;
private double M40_APV_CNT;
private double M50_APV_CNT;
private double M60_APV_CNT;
private double W10_APV_CNT;
private double W20_APV_CNT;
private double W30_APV_CNT;
private double W40_APV_CNT;
private double W50_APV_CNT;
private double W60_APV_CNT;
private double M10_SALE_AMT;
private double M20_SALE_AMT;
private double M30_SALE_AMT;
private double M40_SALE_AMT;
private double M50_SALE_AMT;
private double M60_SALE_AMT;
private double W10_SALE_AMT;
private double W20_SALE_AMT;
private double W30_SALE_AMT;
private double W40_SALE_AMT;
private double W50_SALE_AMT;
private double W60_SALE_AMT;
public String getDate(){return Date;}
public void setDate(String STD){this.Date=STD;}
public String getDistrict_code(){return District_code;}
public void setDistrict_code(String block){this.District_code=block;}
public String getBusiness_code(){return Business_code;}
public void setBusiness_code(String CD){this.Business_code=CD;}
public String getBusiness_name(){return Business_name;}
public void setBusiness_name(String NM){this.Business_name=NM;}
public double getM10_APV_CNT(){return M10_APV_CNT;}
public void setM10_APV_CNT(double m10){this.M10_APV_CNT=m10;}
public double getM20_APV_CNT(){return M20_APV_CNT;}
public void setM20_APV_CNT(double m20){this.M20_APV_CNT=m20;}
public double getM30_APV_CNT(){return M30_APV_CNT;}
public void setM30_APV_CNT(double m30){this.M30_APV_CNT=m30;}
public double getM40_APV_CNT(){return M40_APV_CNT;}
public void setM40_APV_CNT(double m40){this.M40_APV_CNT=m40;}
public double getM50_APV_CNT(){return M50_APV_CNT;}
public void setM50_APV_CNT(double m50){this.M50_APV_CNT=m50;}
public double getM60_APV_CNT(){return M60_APV_CNT;}
public void setM60_APV_CNT(double m60){this.M60_APV_CNT=m60;}
public double getW10_APV_CNT(){return W10_APV_CNT;}
public void setW10_APV_CNT(double w10){this.W10_APV_CNT=w10;}
public double getW20_APV_CNT(){return W20_APV_CNT;}
public void setW20_APV_CNT(double w20){this.W20_APV_CNT=w20;}
public double getW30_APV_CNT(){return W30_APV_CNT;}
public void setW30_APV_CNT(double w30){this.W30_APV_CNT=w30;}
public double getW40_APV_CNT(){return W40_APV_CNT;}
public void setW40_APV_CNT(double w40){this.W40_APV_CNT=w40;}
public double getW50_APV_CNT(){return W50_APV_CNT;}
public void setW50_APV_CNT(double w50){this.W50_APV_CNT=w50;}
public double getW60_APV_CNT(){return W60_APV_CNT;}
public void setW60_APV_CNT(double w60){this.W60_APV_CNT=w60;}
public double getM10_SALE_AMT(){return M10_SALE_AMT;}
public void setM10_SALE_AMT(double m10){this.M10_SALE_AMT=m10;}
public double getM20_SALE_AMT(){return M20_SALE_AMT;}
public void setM20_SALE_AMT(double m20){this.M20_SALE_AMT=m20;}
public double getM30_SALE_AMT(){return M30_SALE_AMT;}
public void setM30_SALE_AMT(double m30){this.M30_SALE_AMT=m30;}
public double getM40_SALE_AMT(){return M40_SALE_AMT;}
public void setM40_SALE_AMT(double m40){this.M40_SALE_AMT=m40;}
public double getM50_SALE_AMT(){return M50_SALE_AMT;}
public void setM50_SALE_AMT(double m50){this.M50_SALE_AMT=m50;}
public double getM60_SALE_AMT(){return M60_SALE_AMT;}
public void setM60_SALE_AMT(double m60){this.M60_SALE_AMT=m60;}
public double getW10_SALE_AMT(){return W10_SALE_AMT;}
public void setW10_SALE_AMT(double w10){this.W10_SALE_AMT=w10;}
public double getW20_SALE_AMT(){return W20_SALE_AMT;}
public void setW20_SALE_AMT(double w20){this.W20_SALE_AMT=w20;}
public double getW30_SALE_AMT(){return W30_SALE_AMT;}
public void setW30_SALE_AMT(double w30){this.W30_SALE_AMT=w30;}
public double getW40_SALE_AMT(){return W40_SALE_AMT;}
public void setW40_SALE_AMT(double w40){this.W40_SALE_AMT=w40;}
public double getW50_SALE_AMT(){return W50_SALE_AMT;}
public void setW50_SALE_AMT(double w50){this.W50_SALE_AMT=w50;}
public double getW60_SALE_AMT(){return W60_SALE_AMT;}
public void setW60_SALE_AMT(double w60){this.W60_SALE_AMT=w60;}
}
POJO 2. SALE_TIME
package org.datanucleus.samples.jdo.tutorial;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.PrimaryKey;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
/**
* Created by Sungjin on 2016-03-15.
*/
@PersistenceCapable
public class SALE_TIME {
@PrimaryKey
@GeneratedValue(strategy = GenerationType.IDENTITY)
private String Date;
private String District_code;
private String Business_code;
private String Business_name;
private double APV_CNT_00_AMT;
private double APV_CNT_01_AMT;
private double APV_CNT_02_AMT;
private double APV_CNT_03_AMT;
private double APV_CNT_04_AMT;
private double APV_CNT_05_AMT;
private double APV_CNT_06_AMT;
private double APV_CNT_07_AMT;
private double APV_CNT_08_AMT;
private double APV_CNT_09_AMT;
private double APV_CNT_10_AMT;
private double APV_CNT_11_AMT;
private double APV_CNT_12_AMT;
private double APV_CNT_13_AMT;
private double APV_CNT_14_AMT;
private double APV_CNT_15_AMT;
private double APV_CNT_16_AMT;
private double APV_CNT_17_AMT;
private double APV_CNT_18_AMT;
private double APV_CNT_19_AMT;
private double APV_CNT_20_AMT;
private double APV_CNT_21_AMT;
private double APV_CNT_22_AMT;
private double APV_CNT_23_AMT;
private double SALE_00_AMT;
private double SALE_01_AMT;
private double SALE_02_AMT;
private double SALE_03_AMT;
private double SALE_04_AMT;
private double SALE_05_AMT;
private double SALE_06_AMT;
private double SALE_07_AMT;
private double SALE_08_AMT;
private double SALE_09_AMT;
private double SALE_10_AMT;
private double SALE_11_AMT;
private double SALE_12_AMT;
private double SALE_13_AMT;
private double SALE_14_AMT;
private double SALE_15_AMT;
private double SALE_16_AMT;
private double SALE_17_AMT;
private double SALE_18_AMT;
private double SALE_19_AMT;
private double SALE_20_AMT;
private double SALE_21_AMT;
private double SALE_22_AMT;
private double SALE_23_AMT;
public String getDate(){return Date;}
public void setDate(String std){this.Date = std;}
public String getDistrict_code(){return District_code;}
public void setDistrict_code(String block){this.District_code = block;}
public String getBusiness_code(){return Business_code;}
public void setBusiness_code(String cd){this.Business_code =cd;}
public String getBusiness_name(){return Business_name;}
public void setBusiness_name(String nm){this.Business_name = nm;}
public double getAPV_CNT_00_AMT(){return APV_CNT_00_AMT;}
public void setAPV_CNT_00_AMT(double apv){this.APV_CNT_00_AMT = apv;}
public double getAPV_CNT_01_AMT(){return APV_CNT_01_AMT;}
public void setAPV_CNT_01_AMT(double apv){this.APV_CNT_01_AMT = apv;}
public double getAPV_CNT_02_AMT(){return APV_CNT_02_AMT;}
public void setAPV_CNT_02_AMT(double apv){this.APV_CNT_02_AMT = apv;}
public double getAPV_CNT_03_AMT(){return APV_CNT_03_AMT;}
public void setAPV_CNT_03_AMT(double apv){this.APV_CNT_03_AMT = apv;}
public double getAPV_CNT_04_AMT(){return APV_CNT_04_AMT;}
public void setAPV_CNT_04_AMT(double apv){this.APV_CNT_04_AMT = apv;}
public double getAPV_CNT_05_AMT(){return APV_CNT_05_AMT;}
public void setAPV_CNT_05_AMT(double apv){this.APV_CNT_05_AMT = apv;}
public double getAPV_CNT_06_AMT(){return APV_CNT_06_AMT;}
public void setAPV_CNT_06_AMT(double apv){this.APV_CNT_06_AMT = apv;}
public double getAPV_CNT_07_AMT(){return APV_CNT_07_AMT;}
public void setAPV_CNT_07_AMT(double apv){this.APV_CNT_07_AMT = apv;}
public double getAPV_CNT_08_AMT(){return APV_CNT_08_AMT;}
public void setAPV_CNT_08_AMT(double apv){this.APV_CNT_08_AMT = apv;}
public double getAPV_CNT_09_AMT(){return APV_CNT_09_AMT;}
public void setAPV_CNT_09_AMT(double apv){this.APV_CNT_09_AMT = apv;}
public double getAPV_CNT_10_AMT(){return APV_CNT_10_AMT;}
public void setAPV_CNT_10_AMT(double apv){this.APV_CNT_10_AMT = apv;}
public double getAPV_CNT_11_AMT(){return APV_CNT_11_AMT;}
public void setAPV_CNT_11_AMT(double apv){this.APV_CNT_11_AMT = apv;}
public double getAPV_CNT_12_AMT(){return APV_CNT_12_AMT;}
public void setAPV_CNT_12_AMT(double apv){this.APV_CNT_12_AMT = apv;}
public double getAPV_CNT_13_AMT(){return APV_CNT_13_AMT;}
public void setAPV_CNT_13_AMT(double apv){this.APV_CNT_13_AMT = apv;}
public double getAPV_CNT_14_AMT(){return APV_CNT_14_AMT;}
public void setAPV_CNT_14_AMT(double apv){this.APV_CNT_14_AMT = apv;}
public double getAPV_CNT_15_AMT(){return APV_CNT_15_AMT;}
public void setAPV_CNT_15_AMT(double apv){this.APV_CNT_15_AMT = apv;}
public double getAPV_CNT_16_AMT(){return APV_CNT_16_AMT;}
public void setAPV_CNT_16_AMT(double apv){this.APV_CNT_16_AMT = apv;}
public double getAPV_CNT_17_AMT(){return APV_CNT_17_AMT;}
public void setAPV_CNT_17_AMT(double apv){this.APV_CNT_17_AMT = apv;}
public double getAPV_CNT_18_AMT(){return APV_CNT_18_AMT;}
public void setAPV_CNT_18_AMT(double apv){this.APV_CNT_18_AMT = apv;}
public double getAPV_CNT_19_AMT(){return APV_CNT_19_AMT;}
public void setAPV_CNT_19_AMT(double apv){this.APV_CNT_19_AMT = apv;}
public double getAPV_CNT_20_AMT(){return APV_CNT_20_AMT;}
public void setAPV_CNT_20_AMT(double apv){this.APV_CNT_20_AMT = apv;}
public double getAPV_CNT_21_AMT(){return APV_CNT_21_AMT;}
public void setAPV_CNT_21_AMT(double apv){this.APV_CNT_21_AMT = apv;}
public double getAPV_CNT_22_AMT(){return APV_CNT_22_AMT;}
public void setAPV_CNT_22_AMT(double apv){this.APV_CNT_22_AMT = apv;}
public double getAPV_CNT_23_AMT(){return APV_CNT_23_AMT;}
public void setAPV_CNT_23_AMT(double apv){this.APV_CNT_23_AMT = apv;}
public double getSALE_00_AMT(){return SALE_00_AMT;}
public void setSALE_00_AMT(double sale){this.SALE_00_AMT = sale;}
public double getSALE_01_AMT(){return SALE_01_AMT;}
public void setSALE_01_AMT(double sale){this.SALE_01_AMT = sale;}
public double getSALE_02_AMT(){return SALE_02_AMT;}
public void setSALE_02_AMT(double sale){this.SALE_02_AMT = sale;}
public double getSALE_03_AMT(){return SALE_03_AMT;}
public void setSALE_03_AMT(double sale){this.SALE_03_AMT = sale;}
public double getSALE_04_AMT(){return SALE_04_AMT;}
public void setSALE_04_AMT(double sale){this.SALE_04_AMT = sale;}
public double getSALE_05_AMT(){return SALE_05_AMT;}
public void setSALE_05_AMT(double sale){this.SALE_05_AMT = sale;}
public double getSALE_06_AMT(){return SALE_06_AMT;}
public void setSALE_06_AMT(double sale){this.SALE_06_AMT = sale;}
public double getSALE_07_AMT(){return SALE_07_AMT;}
public void setSALE_07_AMT(double sale){this.SALE_07_AMT = sale;}
public double getSALE_08_AMT(){return SALE_08_AMT;}
public void setSALE_08_AMT(double sale){this.SALE_08_AMT = sale;}
public double getSALE_09_AMT(){return SALE_09_AMT;}
public void setSALE_09_AMT(double sale){this.SALE_09_AMT = sale;}
public double getSALE_10_AMT(){return SALE_10_AMT;}
public void setSALE_10_AMT(double sale){this.SALE_10_AMT = sale;}
public double getSALE_11_AMT(){return SALE_11_AMT;}
public void setSALE_11_AMT(double sale){this.SALE_11_AMT = sale;}
public double getSALE_12_AMT(){return SALE_12_AMT;}
public void setSALE_12_AMT(double sale){this.SALE_12_AMT = sale;}
public double getSALE_13_AMT(){return SALE_13_AMT;}
public void setSALE_13_AMT(double sale){this.SALE_13_AMT = sale;}
public double getSALE_14_AMT(){return SALE_14_AMT;}
public void setSALE_14_AMT(double sale){this.SALE_14_AMT = sale;}
public double getSALE_15_AMT(){return SALE_15_AMT;}
public void setSALE_15_AMT(double sale){this.SALE_15_AMT = sale;}
public double getSALE_16_AMT(){return SALE_16_AMT;}
public void setSALE_16_AMT(double sale){this.SALE_16_AMT = sale;}
public double getSALE_17_AMT(){return SALE_17_AMT;}
public void setSALE_17_AMT(double sale){this.SALE_17_AMT = sale;}
public double getSALE_18_AMT(){return SALE_18_AMT;}
public void setSALE_18_AMT(double sale){this.SALE_18_AMT = sale;}
public double getSALE_19_AMT(){return SALE_19_AMT;}
public void setSALE_19_AMT(double sale){this.SALE_19_AMT = sale;}
public double getSALE_20_AMT(){return SALE_20_AMT;}
public void setSALE_20_AMT(double sale){this.SALE_20_AMT = sale;}
public double getSALE_21_AMT(){return SALE_21_AMT;}
public void setSALE_21_AMT(double sale){this.SALE_21_AMT = sale;}
public double getSALE_22_AMT(){return SALE_22_AMT;}
public void setSALE_22_AMT(double sale){this.SALE_22_AMT = sale;}
public double getSALE_23_AMT(){return SALE_23_AMT;}
public void setSALE_23_AMT(double sale){this.SALE_23_AMT = sale;}
}
这是一个主要方法。
package org.datanucleus.samples.jdo.tutorial;
import com.sun.org.apache.xpath.internal.SourceTree;
import org.datanucleus.samples.jdo.tutorial.NOT_EMBEDDED.NOT_EMBEDDED_SALE_AGE;
import org.datanucleus.samples.jdo.tutorial.NOT_EMBEDDED.NOT_EMBEDDED_SALE_TIME;
import java.io.*;
import java.util.Iterator;
import java.util.List;
import javax.jdo.PersistenceManager;
import javax.jdo.PersistenceManagerFactory;
import javax.jdo.Extent;
import javax.jdo.Query;
import javax.jdo.JDOHelper;
import javax.jdo.Transaction;
import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.EntityTransaction;
import javax.persistence.Persistence;
public class Main {
public static void main(String args[]) throws Exception {
PersistenceManagerFactory pmf = JDOHelper.getPersistenceManagerFactory("Tutorial");
PersistenceManager pm = pmf.getPersistenceManager();
Transaction tx = pm.currentTransaction();
BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream("Age Data.txt"), "euc-kr"));
String[] arr = {"201303", "201304", "201305", "201306", "201307", "201308", "201309", "201310", "201311", "201312", "201401", "201402"};
String url = "src/main/resources/SALE_AGES/DMS_SALES_EST_AGE_";
long total_time = 0;
try {
for (String s : arr) {
String filepath = url + s + ".txt";
BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream(new File(filepath)), "euc-kr"));
String line;
int i = 0;
int count = 0;
tx.begin();
while ((line = reader.readLine()) != null) {
if (i != 0) {
System.out.println(line);
SALE_AGE data = SaleAgeData(line);
System.out.println("datain");
pm.makePersistent(data);//error occurs
System.out.println("persisted");
tx.commit();
System.out.println("commited");
pm.deletePersistent(data);
} else {
i++;
}
}
}
} catch (Exception e) {
System.out.println("Exception persisting data : " + e.getMessage());
}
finally {
if (tx.isActive()) {
tx.rollback();
}
pm.close();
}
}
static SALE_AGE SaleAgeData(String line) throws Exception {
String[] fields = line.split("\\|");
SALE_AGE tmp = new SALE_AGE();
tmp.setDate((fields[0]));
tmp.setDistrict_code(fields[1]);
tmp.setBusiness_code(fields[2]);
tmp.setBusiness_name(fields[3]);
tmp.setM10_APV_CNT(Double.parseDouble(fields[4]));
tmp.setM10_APV_CNT(Double.parseDouble(fields[5]));
tmp.setM10_APV_CNT(Double.parseDouble(fields[6]));
tmp.setM10_APV_CNT(Double.parseDouble(fields[7]));
tmp.setM10_APV_CNT(Double.parseDouble(fields[8]));
tmp.setM10_APV_CNT(Double.parseDouble(fields[9]));
tmp.setW10_APV_CNT(Double.parseDouble(fields[10]));
tmp.setW10_APV_CNT(Double.parseDouble(fields[11]));
tmp.setW10_APV_CNT(Double.parseDouble(fields[12]));
tmp.setW10_APV_CNT(Double.parseDouble(fields[13]));
tmp.setW10_APV_CNT(Double.parseDouble(fields[14]));
tmp.setW10_APV_CNT(Double.parseDouble(fields[15]));
tmp.setM10_SALE_AMT(Double.parseDouble(fields[16]));
tmp.setM20_SALE_AMT(Double.parseDouble(fields[17]));
tmp.setM30_SALE_AMT(Double.parseDouble(fields[18]));
tmp.setM40_SALE_AMT(Double.parseDouble(fields[19]));
tmp.setM50_SALE_AMT(Double.parseDouble(fields[20]));
tmp.setM60_SALE_AMT(Double.parseDouble(fields[21]));
tmp.setW10_SALE_AMT(Double.parseDouble(fields[22]));
tmp.setW20_SALE_AMT(Double.parseDouble(fields[23]));
tmp.setW30_SALE_AMT(Double.parseDouble(fields[24]));
tmp.setW40_SALE_AMT(Double.parseDouble(fields[25]));
tmp.setW50_SALE_AMT(Double.parseDouble(fields[26]));
tmp.setW60_SALE_AMT(Double.parseDouble(fields[27]));
return tmp;
}
static SALE_TIME SaleTimeData(String line) throws Exception {
String[] fields = line.split("\\|");
SALE_TIME tmp = new SALE_TIME();
tmp.setDate((fields[0]));
tmp.setDistrict_code(fields[1]);
tmp.setBusiness_code(fields[2]);
tmp.setBusiness_name(fields[3]);
tmp.setAPV_CNT_00_AMT(Double.parseDouble(fields[4]));
tmp.setAPV_CNT_01_AMT(Double.parseDouble(fields[5]));
tmp.setAPV_CNT_02_AMT(Double.parseDouble(fields[6]));
tmp.setAPV_CNT_03_AMT(Double.parseDouble(fields[7]));
tmp.setAPV_CNT_04_AMT(Double.parseDouble(fields[8]));
tmp.setAPV_CNT_05_AMT(Double.parseDouble(fields[9]));
tmp.setAPV_CNT_06_AMT(Double.parseDouble(fields[10]));
tmp.setAPV_CNT_07_AMT(Double.parseDouble(fields[11]));
tmp.setAPV_CNT_08_AMT(Double.parseDouble(fields[12]));
tmp.setAPV_CNT_09_AMT(Double.parseDouble(fields[13]));
tmp.setAPV_CNT_10_AMT(Double.parseDouble(fields[14]));
tmp.setAPV_CNT_11_AMT(Double.parseDouble(fields[15]));
tmp.setAPV_CNT_12_AMT(Double.parseDouble(fields[16]));
tmp.setAPV_CNT_13_AMT(Double.parseDouble(fields[17]));
tmp.setAPV_CNT_14_AMT(Double.parseDouble(fields[18]));
tmp.setAPV_CNT_15_AMT(Double.parseDouble(fields[19]));
tmp.setAPV_CNT_16_AMT(Double.parseDouble(fields[20]));
tmp.setAPV_CNT_17_AMT(Double.parseDouble(fields[21]));
tmp.setAPV_CNT_18_AMT(Double.parseDouble(fields[22]));
tmp.setAPV_CNT_19_AMT(Double.parseDouble(fields[23]));
tmp.setAPV_CNT_20_AMT(Double.parseDouble(fields[24]));
tmp.setAPV_CNT_21_AMT(Double.parseDouble(fields[25]));
tmp.setAPV_CNT_22_AMT(Double.parseDouble(fields[26]));
tmp.setAPV_CNT_23_AMT(Double.parseDouble(fields[27]));
tmp.setSALE_00_AMT(Double.parseDouble(fields[28]));
tmp.setSALE_01_AMT(Double.parseDouble(fields[29]));
tmp.setSALE_02_AMT(Double.parseDouble(fields[30]));
tmp.setSALE_03_AMT(Double.parseDouble(fields[31]));
tmp.setSALE_04_AMT(Double.parseDouble(fields[32]));
tmp.setSALE_05_AMT(Double.parseDouble(fields[33]));
tmp.setSALE_06_AMT(Double.parseDouble(fields[34]));
tmp.setSALE_07_AMT(Double.parseDouble(fields[35]));
tmp.setSALE_08_AMT(Double.parseDouble(fields[36]));
tmp.setSALE_09_AMT(Double.parseDouble(fields[37]));
tmp.setSALE_10_AMT(Double.parseDouble(fields[38]));
tmp.setSALE_11_AMT(Double.parseDouble(fields[39]));
tmp.setSALE_12_AMT(Double.parseDouble(fields[40]));
tmp.setSALE_13_AMT(Double.parseDouble(fields[41]));
tmp.setSALE_14_AMT(Double.parseDouble(fields[42]));
tmp.setSALE_15_AMT(Double.parseDouble(fields[43]));
tmp.setSALE_16_AMT(Double.parseDouble(fields[44]));
tmp.setSALE_17_AMT(Double.parseDouble(fields[45]));
tmp.setSALE_18_AMT(Double.parseDouble(fields[46]));
tmp.setSALE_19_AMT(Double.parseDouble(fields[47]));
tmp.setSALE_20_AMT(Double.parseDouble(fields[48]));
tmp.setSALE_21_AMT(Double.parseDouble(fields[49]));
tmp.setSALE_22_AMT(Double.parseDouble(fields[50]));
tmp.setSALE_23_AMT(Double.parseDouble(fields[51]));
return tmp;
}
}
当我运行它时,第一行
201303|11220600300011000001|307009|������|0|8205|31102|23541|11972|6869|0|2863|12005|8553|5875|2022|0|464743912.58|2068701224.98|1802065918.66|933525067.07|502156752.49|0|156241028.98|759822379.88|604698640.27|412770581.02|148236607.2
插入好但在第一次输入后,
异常持久化数据:StateManager插入对象的异常[pc = org.datanucleus.samples.jdo.tutorial.SALE_AGE@4b9a6c67,lifecycle = P_NEW]
发生异常。
我不知道为什么第二行不会持续存在。也许,我是否对持久性管理器做错了?
任何人都可以帮助我为什么不能保留所有数据?