在Oracle DB中显示(BLOB),使用上面的代码显示图像,但显示黑屏。
使用setBinaryStream
通过Java JDBC连接存储Blob代码:
<?php
$id = $_GET['serial_id'];
$id1 = $_GET['serial_id1'];
$id2 = $_GET['serial_id2'];
$sql2 = "SELECT * FROM Mapping WHERE PRODUCT ='".$id1."' and (ID='".$id."' or VALUE='".$id2."')";
echo $sql2;
$array2 = oci_parse($conn, $sql2);
oci_execute($array2,OCI_NO_AUTO_COMMIT);
//$result=oci_fetch_array($array2);
$result = oci_fetch_assoc($array2);
if (is_object($result['SCREENSHOT'])) {
$result11 = $result['SCREENSHOT']->load();
header("Content-type: image/JPEG");
echo $result11;
}
?>
截图: