hello friends,
i am gettting the two binary data as separate inputstreams from sql server
and when further i am doing some operation on two streams, on the first stream it's finishing successfully and giving error object has been closed
Is one have solution
code :
while(rSet.next())
{
String strDestPath = "c:\\TestSharepointExport";
strLeafName = rSet.getString("leafName");
System.out.println("File Name" + strLeafName);
intType = rSet.getInt("type");
System.out.println("Type*******"+intType);
strDirectoryName = rSet.getString("dirName");
iStreamMeta = rSet.getBinaryStream("metainfo");
iStream = rSet.getBinaryStream("content");
System.out.println("iStream++++++++"+iStream);
System.out.println("blnWhereCondition------>"+blnWhereCondition);
if(blnWhereCondition == true)
{
fileOp = new File(strDestPath,strLeafName);
ostr = new FileOutputStream(fileOp);
while((size=iStream.read(bytearray))!=-1)
{
ostr.write(bytearray,0,size);
}
iStream.close();
String strTempFileName = getFileNameWithoutExtensionstrLeafName);
String strMetaFileName = strTempFileName + "Metainfo.txt";
System.out.println("strMetaFileName=="+strMetaFile Name);
fileOpMeta = new File(strDestPath,strMetaFileName);
ostrMeta = new FileOutputStream(fileOpMeta);
while((intSizeMeta=iStreamMeta.read(bytearrayMeta) )!=-1)
{
ostr.write(bytearray,0,intSizeMeta);
}// end of while((intSizeMeta=iStreamMeta.read(bytearrayMeta) )!=-1)
}// end of if(blnWhereCondition == true)
....
......more code
while((intSizeMeta=iStreamMeta.read(bytearrayMeta) )!=-1) at this line it is giving me error :
-- java.io.IOException: [Microsoft][SQLServer 2000 Driver for JDBC]Object has been closed.