Boz*_*zho 19
在你的ResultSet
电话上:
Blob imageBlob = resultSet.getBlob(yourBlobColumnIndex);
InputStream binaryStream = imageBlob.getBinaryStream(0, imageBlob.length());
Run Code Online (Sandbox Code Playgroud)
或者,您可以致电:
byte[] imageBytes = imageBlob.getBytes(1, (int) imageBlob.length());
Run Code Online (Sandbox Code Playgroud)
正如BalusC在评论中指出的那样,你最好使用:
InputStream binaryStream = resultSet.getBinaryStream(yourBlobColumnIndex);
Run Code Online (Sandbox Code Playgroud)
然后代码取决于您将如何阅读和嵌入图像.