Oracle Database BLOB to InputStream in Java?

后端 未结 2 2076
小蘑菇
小蘑菇 2020-12-11 07:24

I made a Java function that takes an InputStream as an input. I have a oracle.sql.BLOB instance to pass to that function. How can I convert it to

2条回答
  •  囚心锁ツ
    2020-12-11 08:20

    You haven't really said how you're fetching data from the database, but you can use ResultSet.getBinaryStream() to get an InputStream, or call getBlob() to get a Blob, and then getBinaryStream() on the Blob to get a stream.

提交回复
热议问题