0

Can we insert a java byte array in hsqldb table as blob datatype by using Statement class(without using prepared statement)?

1 Answer 1

1

Since you shouldn't insert user data into a SQL statement using string concatenation anyway, why do you care?

Using PreparedStatement is the right way to do it.


Though, technically, you could execute a SELECT statement, and insert the data using an updatable ResultSet, but I wouldn't recommend it. Inserting a row using a dummy SELECT statement is just plain unnecessary overhead.

Or you could build a HSQLDB Binary Literal, but why go through all that work, when you'll get it for free with a PreparedStatement?

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.