Tim*_*ote 74
mySql blob类具有以下功能:
blob.getBytes
像这样用它:
//(assuming you have a ResultSet named RS)
Blob blob = rs.getBlob("SomeDatabaseField");
int blobLength = (int) blob.length();
byte[] blobAsBytes = blob.getBytes(1, blobLength);
//release the blob and free up memory. (since JDBC 4.0)
blob.free();
Run Code Online (Sandbox Code Playgroud)
Luk*_*der 49
在最简单的方法是这样的.
byte[] bytes = rs.getBytes("my_field");
Run Code Online (Sandbox Code Playgroud)