473,503 Members | 1,360 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

problem with two input streams that contains binary data

1 New Member
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.
Jul 18 '07 #1
0 911

Sign in to post your reply or Sign up for a free account.

Similar topics

1
3394
by: Marc Cromme | last post by:
I would like to ask a question about (good ?) style and possibilities in mixing C FILE* and C++ file streams. The background is that I want to use the C libpng library from within C++, but I...
6
2062
by: Nick R | last post by:
I need to know how to input bits from a *.wav file. I have tried this: #include <fstream> .... ifstream fin; fin.open("/root/foofile.wav", ios::in|ios::binary); and then inputting...
3
3472
by: Tron Thomas | last post by:
What does binary mode for an ofstream object do anyway? Despite which mode the stream uses, operator << writes numeric value as their ASCII representation. I read on the Internet that it is...
15
3602
by: Hemant Shah | last post by:
Folks, We have an SQL statement that was coded in an application many years ago (starting with DB V2 I think). When I upgraded to UDB 8.2, the optimizer does not use optimal path to access the...
1
2398
by: Chris | last post by:
I'm reading up on streams and I have two articles that seem to conflict with each other. One article describes streams and lists a few of the major ones (FileStream, Memory Stream, Network...
1
1237
by: sham | last post by:
Hi to all, I am using ICSharpCode.SharpZipLib.Zip. My zip file contains a number of images which when they get unzipped only contain a partial image. The filesize looks correct. The...
12
3381
by: Julian | last post by:
Hi, I am having problems with a function that I have been using in my program to read sentences from a 'command file' and parse them into commands. the surprising thing is that the program works...
0
3474
by: shahiz | last post by:
This the error i get when i try to run my program Error: Unable to realize com.sun.media.amovie.AMController@18b81e3 Basically i have a mediapanel class that initialize and play the media as...
27
5062
by: Jeff | last post by:
Im trying to figure out why I cant read back a binary file correctly. I have the following union: #define BITE_RECORD_LEN 12 typedef union { unsigned char byte; struct { unsigned char type;...
0
7089
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7282
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7339
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6995
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
1
5017
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4678
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3168
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
1
738
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
389
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.