I want to convert byte[] array to Blob type

Asked 2 years ago, Updated 2 years ago, 31 views

How do I convert the byte[] array to Blob in Java?
There is a way to get Blob with getByte(), but the reverse is not.

java

2022-09-30 16:15

2 Answers

Connection#createBlob() to create objects generated using the setBytes methodI think I can.

See also the reference for your JDBC driver.


2022-09-30 16:15

I wonder if I can refer to this area. The example is binaryStram, but also from Byte array
Can't I do it in a similar way?

https://docs.oracle.com/javase/jp/8/docs/api/java/sql/Blob.html


2022-09-30 16:15

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.