怎么把数据库的数据读出转化成一种格式,在另一个系统应用
具体说是这样的: 原来有一个系统,用的是单机版的,数据有个导入导出,格式是.rdpg,系统自己定义的格式吧,只有在这个系统才能打开,现在我用java做成B/S版的了,但是,因为系统的需要,数据还是需要导出的,但怎么导出成他这个系统的格式呢?
现在可以把他这个系统的.rdpg文件,通过下面这样变成.zip格式的,可以看见里面的内容,现在我想把数据库的数据读出来写成一样的,但是怎么才能变成.rdpg文件,给个思路???????
public static void upload(String src,String desc) throws FileNotFoundException{
File srcFile=new File(src);
File descFile=new File(desc);
FileInputStream fis=new FileInputStream(srcFile);
FileOutputStream fos=new FileOutputStream(descFile);
byte buffer[]=new byte[1024*1024];
int n=0;
try {
while (-1!=(n=fis.read(buffer))) {
fos.write(buffer,0,n);
}
} catch (IOException e) {
e.printStackTrace();
}finally{
try {
if (fos!=null) {
fos.close();
}
if (fis!=null) {
fis.close();
}
} catch (Exception e2) {
e2.printStackTrace();
}
}
public static void main(String[] args)throws FileNotFoundException {
upload("e:/a.rdpg","e:/b.zip ");
//.rdpk
}