用java怎么读取数据库中数据,并生成XML文件

从数据库开始写到生成xml文件,麻烦了,数据库是sqlserver。
2024-12-30 16:20:35
推荐回答(1个)
回答1:

用流读出来,
File sdCardDir = Environment.getExternalStorageDirectory();
File saveFile = new File(sdCardDir, path + "/" + aFileName);
FileOutputStream outStream = new FileOutputStream(saveFile,aIsApp);
BufferedReader reader = null;
reader = new BufferedReader(new FileReader(objFile));我这是sd卡上读txt文档的代码,你看看