java创建xml文档

来源:百度知道 编辑:UC知道 时间:2024/05/16 13:59:24
java中怎么创建xml文档,不是使用第三方的库包,该怎么写,我的QQ是:474483925,请问一下我该怎么写

stmt.execute(SQL);
RS = stmt.getResultSet();
while (RS == null && stmt.getMoreResults())
{
RS = stmt.getResultSet();
}

OutputStream os = new FileOutputStream(new File(file));
OutputStreamWriter osw = new OutputStreamWriter(os);
InputStream is = null;
InputStreamReader isr = null;
int c;
osw.write("<?xml version=\"1.0\"?>");
osw.write("<root>");
while (RS.next())
{