}
- RapideLoader(String _database) throws Exception{
+ RapideLoader(String _database) {
super();
database = _database;
}
- private void load() throws Exception{
+ private void load(){
Connection conn = null;
PreparedStatement stmt = null;
PreparedStatement stmt_ins = null;
int fl_col_count = 0;
boolean isLob = false;
boolean isContinue = false;
+ CmnProperty cp = null;
+ DataAccessObjects dao = null;
- CmnProperty cp = new CmnProperty();
- cp.setProperty(database);
-
- DataAccessObjects dao = new DataAccessObjects(cp.user, cp.pass, cp.url, cp.driver);
try {
- conn = dao.connect();
- conn.setAutoCommit(false);
+ cp = new CmnProperty();
+ cp.setProperty(database);
if(cp.inFolder != null){
folder = new File(cp.inFolder);
folder = new File(cp.DEFAULT_IN_FOLDER + "/" + cp.DB_TYPE_NAME[cp.dbType].toUpperCase());
}
}
- CmnUtils.infoPrint("-->\93ü\97Í\8c³='" + folder + "'");
+ CmnUtils.infoPrint("-->\93ü\97Í\8c³\83t\83H\83\8b\83_='" + folder + "'");
CmnUtils.infoPrint("\83f\81[\83^\83\8d\81[\83h\82ð\8aJ\8en\82µ\82Ü\82µ\82½\81B");
-
+ dao = new DataAccessObjects(cp);
+ conn = dao.connect();
+ conn.setAutoCommit(false);
dao.select(cp.tSql);
alData = dao.getArrayList();
tb_count = dao.getColumnCount();
}
colIncl = (Boolean[])alColIncl.toArray(new Boolean[0]);
-
sql_insert = "INSERT INTO " + tbName + "(";
for(int j=0;j<colData.length;j++){
for(int l=0;l<tb_col_count;l++){
CmnUtils.infoPrinting(String.format("%1$-30s",tbName));
} else {
dao.rollback();
- CmnUtils.debugPrint("column count is zero");
+ CmnUtils.debugPrint("\8ew\92è\82µ\82½\8bæ\90Ø\82è\95¶\8e\9a\82Å\82Ì\83J\83\89\83\80\90\94\82ª0\82Å\82·\81B");
if(br != null){
br.close();
br=null;
if(colData.length == fl_col_count){
if(!strMltLine.equals("")){
dao.rollback();
- System.out.println(String.format("%1$10d",tb_rec_count) + " ERROR:column count is unmatch");
+ CmnUtils.errorPrint("\8aY\93\96\83\8c\83R\81[\83h\82Ì\83J\83\89\83\80\90\94\82ª\83A\83\93\83}\83b\83`\82Å\82·\81B[" + tb_rec_count + "]");
CmnUtils.debugPrint("************Record End");
if(br != null){
br.close();
isContinue = false;
} else if(colData.length >fl_col_count){
dao.rollback();
- CmnUtils.errorPrint(String.format("%1$10d",tb_rec_count) + "column count is unmatch");
+ CmnUtils.errorPrint("\8aY\93\96\83\8c\83R\81[\83h\82Ì\83J\83\89\83\80\90\94\82ª\83A\83\93\83}\83b\83`\82Å\82·\81B[" + tb_rec_count + "]");
CmnUtils.debugPrint("************Record End");
if(br != null){
br.close();
stmt_ins.setClob(j+1,null,0);
}
} else {
- CmnUtils.errorPrint("unmatch column type=" + colTypeName[tb_col_seq[j]]);
+ CmnUtils.errorPrint("\83J\83\89\83\80\82Ì\83f\81[\83^\8c^\82ª\91Î\8fÛ\8aO\82Å\82·\81B[" + colTypeName[tb_col_seq[j]] + "]");
break TABLE_LOOP;
}
}
}
if(!isLob)stmt_ins.executeBatch();
dao.commit();
- System.out.println(String.format("%1$10d",tb_rec_count) + " rows imported");
+ System.out.println(String.format("%1$10d",tb_rec_count) + " \8ds \83\8d\81[\83h\82³\82ê\82Ü\82µ\82½\81B");
CmnUtils.debugPrint("************Record End");
if(br != null){
br.close();
}
}
} else {
- throw new Exception("Folder Not Found(" + folder + ")");
+ CmnUtils.errorPrint("\93ü\97Í\8c³\83t\83H\83\8b\83_\82ª\8c©\82Â\82©\82è\82Ü\82¹\82ñ\81B[" + folder + "]");
}
- dao.disconnect();
+ CmnUtils.infoPrint("\83f\81[\83^\83\8d\81[\83h\82ð\8fI\97¹\82µ\82Ü\82µ\82½\81B");
} catch (Exception e) {
- dao.rollback();
- throw e;
+ try{
+ CmnUtils.errorPrint(e.toString());
+ e.printStackTrace();
+ dao.rollback();
+ } catch (Exception ee) {}
} finally{
- if(stmt != null){
- stmt.close();
- stmt=null;
- }
- if(stmt_ins != null){
- stmt_ins.close();
- stmt_ins=null;
- }
- if(br!=null){
- br.close();
- br=null;
- }
+ try{
+ dao.disconnect();
+ if(stmt != null){
+ stmt.close();
+ stmt=null;
+ }
+ if(stmt_ins != null){
+ stmt_ins.close();
+ stmt_ins=null;
+ }
+ if(br!=null){
+ br.close();
+ br=null;
+ }
+ } catch (Exception e) {}
}
- CmnUtils.infoPrint("\83f\81[\83^\83\8d\81[\83h\82ð\8fI\97¹\82µ\82Ü\82µ\82½\81B");
}
-
-
}
-