You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-java@ibatis.apache.org by Andrey Rogov <an...@gmail.com> on 2007/04/10 15:14:13 UTC

Re: Insert BLOB with Sql Server

http://wiki.apache.org/ibatis/How_do_I_use_a_Custom_Type_Handler_with_a_BLOB_or_CLOB

2007/4/10, Andrea Occhi <an...@consoft.it>:
>
> Hallo everybody and thanks in advance for the answers.
> I'm developing an application with Struts and iBatis.
> I'm very happy about how iBatis works but I have a problem.
> I must insert an image file into the SQL Server database, but I can't, and
> I
> can't find any documentation on the net. I tried many things, and read
> plenty of docs, but I can't find a working example with SQLMap. I found
> something but they use PreparedStatements.
> Can Anybody help me?
> Thanks
> Andrea Occhi
>

R: Insert BLOB with Sql Server

Posted by Andrea Occhi <an...@consoft.it>.
thanks for all answer. 
My app rebegun to work!
thanks again 
Andrea

  _____  

Da: Koka Kiknadze [mailto:226057@gmail.com] 
Inviato: martedì 10 aprile 2007 16.47
A: user-java@ibatis.apache.org
Oggetto: Re: Insert BLOB with Sql Server


Hm, it works for me quite straighforward. I have a table with two columns:
ImageID: numeric and Image: image. Also I have a ByteStore class with two
fields int bytesID and byte[] bytes. 

The SQLMap is trivial, and it works (I use it to store uploaded images, ) 
<insert id='insertByteStore' parameterClass='.....ByteStore'>
     insert into Images (ImageID,image) 
         values ( #bytesID#,#bytes#) 
</insert>




Re: Insert BLOB with Sql Server

Posted by Koka Kiknadze <22...@gmail.com>.
Hm, it works for me quite straighforward. I have a table with two columns:
ImageID: numeric and Image: image. Also I have a ByteStore class with two
fields int bytesID and byte[] bytes.

The SQLMap is trivial, and it works (I use it to store uploaded images, )
<insert id='insertByteStore' parameterClass='.....ByteStore'>
     insert into Images (ImageID,image)
         values ( #bytesID#,#bytes#)
</insert>