Hi,
I am trying to insert a Hexadecimal Literal into a varchar column. My overall system logic relies on PreparedStatements, and if I try, setString(1, hexString); my string is wrapped into quotes (note that hexString is a String that stores the hex value):
insert into t1 (col1) values ('X''4D7953514C''');
The goal for the PS is to look like this:
insert into t1 (col1) values (X'4D7953514C');
I have tried setObject() without success, it somehow detects that my variable is a string and wraps it into quotes.
Is it possible to do that with PreparedStatments or do I have to fall back to build the sql query first with a StringBuilder.
I am trying to insert a Hexadecimal Literal into a varchar column. My overall system logic relies on PreparedStatements, and if I try, setString(1, hexString); my string is wrapped into quotes (note that hexString is a String that stores the hex value):
insert into t1 (col1) values ('X''4D7953514C''');
The goal for the PS is to look like this:
insert into t1 (col1) values (X'4D7953514C');
I have tried setObject() without success, it somehow detects that my variable is a string and wraps it into quotes.
Is it possible to do that with PreparedStatments or do I have to fall back to build the sql query first with a StringBuilder.