users@glassfish.java.net

Insert varbinary in sql server using sql query

From: <glassfish_at_javadesktop.org>
Date: Mon, 14 May 2007 19:24:45 PDT

Hi all,

I am using sql query to insert bytes[] into sql server.

I am reading a image file and the inserting bytes[] in sql server field which is of data type varbinary datatype.

Its giving the following error.


[b]java.sql.SQLException: [Microsoft][ODBC SQL Server Driver][SQL Server]Disallowed implicit conversion from data type varchar to data type varbinary, table 'emcommerce.dbo.Content', column 'ContentObj'. Use the CONVERT function to run this query.
[/b]

Please help me with this.

Thanx
Deepak
[Message sent by forum member 'deepak1234' (deepak1234)]

http://forums.java.net/jive/thread.jspa?messageID=216880