You should be able to store binary data in an image column in SQL Server. Can you give an example of where the code is giving a NPE? [ September 12, 2005: Message edited by: Dave Salter ]
Joined: Aug 08, 2005
I have found out where the problem is occuring. Actually I have the image data which i have converted to bytes & sending it to my servlet in small chunks .Then on the servlet I am opening an input stream & writing all the data from that inputstream to ByteArrayOutputStream till read() doesn't = -1 . Then i am converting the data written to the ByteArrayOutputStream to byteArr & then inserting that byte into the database.
Here the problem is occuriing the whole byte is not getting properly inserted into the database & thats why i am facing difficulty in fetching that data.
So kindly guide me how to write a byte into Sql Server database having datatype "image" & how to retrieve the same.