dom4j一次写入2W条数据
内存溢出,在线等
dom4j有一个write Element的方法,在循环中写入文件的话,没有根节点和文件头,想问问各位有没解决办法,以下是部分代码:
public class FriendsViewByTableName
{
private XMLWriter writer = null;
//调用dom4j中的一个类来解决中文问题,在得到writer时把format传进去
OutputFormat format = OutputFormat.createPrettyPrint();
public void viewData(Adm_chgtmp adm)
{
/** 指定XML编码 */
format.setEncoding( "GBK ");
String tableName = null;
String columnName = null;
String columnValue = null;
Element friendElement = null;
Element ageElement = null;
Document document = null;
String sql = " ";
String sql1 = " ";
ResultSet rs = null;
ResultSet rs1 = null;
dbcon connect = null;
String TMPID = adm.getTMPID();
String TMPDESC = adm.getTMPDESC();
String ALLROWS = adm.getALLROWS();
String MARKISNEW = adm.getMARKISNEW();
String DELETEON = adm.getDELETEON();