How to get the "varbinary" content as it is from MySql, as java string while making a stored procedure call?
So, I am making a simple JDBC call with my StoredProcedure name and input parameters map(parametersMap):- Map map = call.execute(parametersMap);
and I am getting a "varbinary" field as Object which has "B@6550f5eb" as value.. But I need it in String format as it is(say 0x64756D6D792064617461).
I tried doing getBytes() but it's not able to cast.
This is my table :-
CREATE TABLE table1 (
id int,
key varchar(255),
keyType varchar(20),
content varbinary(max)
)
This is my StoredProcedure:-
ALTER PROCEDURE docContent
@DocId AS INT
AS
BEGIN
SET NOCOUNT ON;
SELECT content
FROM table1
WHERE id = @DocId
END