InputStream image = null;
String len = null;
long length = 0;
InputStream a = null;
int fileLength = 0;
File file = null;
File str = null;
image = rs_1.getBinaryStream(meta.getColumnName(k));        //rs_1是远程的SQL SERVER的记录集                                  
len = image.toString();
length = len.length();
int ch = 0;
byte[] buffer = new byte[(int)length];          //定义 buffer为缓冲区每次读取内容的长度
//byte[] buffer = new byte[(int)length];
String filePath = "./soft/" + rs_1.getString(meta.getColumnName(k-1));
file = new File(filePath);//将数据写入文件
if(!file.exists()) {
    file.createNewFile();
}
FileOutputStream newFile = new FileOutputStream(file,true);
boolean go = true;
while(go) {
    while((ch = image.read(buffer))!=-1) {
        newFile.write(buffer,0,ch);
    }
    go = false;
}
image.close();
newFile.close();
                                                
str = new File(filePath);
System.out.println(filePath);
fileLength = (int)str.length();
a = new FileInputStream(str);preStmt_2.setBinaryStream(1, a, fileLength);             //preStmt_2是本地的ORACLE