IBM DB2数据复制以及迁移,以实例讲述

  发布时间:2025-11-05 01:28:29   作者:玩站小弟   我要评论
复制*@paramfilePath */ publicvoidcreateExportFile(Connectionconn,Stringcreator 。
IBM DB2数据复制以及迁移,以实例讲述
复制* @param filePath   */   public void createExportFile(Connection conn,数实例String creator,String filePath) throws Exception {   DBBase dbBase = new DBBase(conn);   String selectTableSql = "select name from sysibm.systables where creator = " + creator + " and type=T";   try {   dbBase.executeQuery(selectTableSql);   } catch (Exception ex) {   throw ex;   } finally {   dbBase.close();   }   DBResult result = dbBase.getSelectDBResult();   List list = new ArrayList();   while (result.next()) {   String table = result.getString(1);   list.add(table);   }   StringBuffer sb = new StringBuffer();   String enterFlag = "\r\n";   for (int i = 0; i   String tableName = (String)list.get(i);   sb.append("db2 \"export to aa" + String.valueOf(i+1)+ ".ixf of ixf select * from " + tableName + "\"");   sb.append(enterFlag);   }   String str = sb.toString();   FileUtility.saveStringToFile(filePath, str, false);   }  1.2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.18.19.20.21.22.23.24.25.26.27.28.
  • Tag:

相关文章

最新评论