ich verwende MYSQL und möchte einen Blob-Datentyp in ein Byte-Array konvertieren.
Ich benutze Java Programmiersprache :)
die MySQL-Blob-Klasse hat die folgende Funktion:
blob.getBytes
benutze es so:
//(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();
Der einfachste Weg ist dieser.
byte[] bytes = rs.getBytes("my_field");