從ORACLE 生成圖片
public static void printPic()throws SQLException{
ResultSet rs=null;
Connection conn=null;
Statement stmt=null;
try {
//從ORACLE 生成圖片
conn=getConn();
stmt=conn.createStatement();
rs=stmt.executeQuery("select zp from jczhxxgl.rk_zzrk where dbms_lob.getlength(zp)>0 and rownum<6");
int i=0;
while(rs.next()){
InputStream fi=null;
Blob blob = rs.getBlob("zp");
FileOutputStream outSTr = new FileOutputStream(new File("c:lll"+i+".jpg"));
i+=1;
BufferedOutputStream Buff=new BufferedOutputStream(outSTr);
Buff.write(blob.getBytes(1, (int)blob.length()));
Buff.flush();
Buff.close();
ResultSet rs=null;
Connection conn=null;
Statement stmt=null;
try {
//從ORACLE 生成圖片
conn=getConn();
stmt=conn.createStatement();
rs=stmt.executeQuery("select zp from jczhxxgl.rk_zzrk where dbms_lob.getlength(zp)>0 and rownum<6");
int i=0;
while(rs.next()){
InputStream fi=null;
Blob blob = rs.getBlob("zp");
FileOutputStream outSTr = new FileOutputStream(new File("c:lll"+i+".jpg"));
i+=1;
BufferedOutputStream Buff=new BufferedOutputStream(outSTr);
Buff.write(blob.getBytes(1, (int)blob.length()));
Buff.flush();
Buff.close();
}
}
catch (Exception ex) {
ex.printStackTrace();
}
finally{
//rs.close();
stmt.close();
conn.close();
}
}
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/9879835/viewspace-1000180/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Flutter 生成圖片Flutter
- 如何生成WebP圖片Web
- 將 HTML 生成圖片HTML
- 圖片生成database 64Database
- python生成圖片Python
- 基於canvas生成圖片Canvas
- 某AI圖片生成網AI
- 生成 Charts 圖片,併傳送 Charts 圖片郵件
- AlamofireImage 使用 – swift載入網路圖片,縮放圖片,生成圓形圖片Swift
- golang 生成圖片驗證碼Golang
- php生成二維碼圖片PHP
- android非同步生成圖片Android非同步
- asp.net上傳圖片生成縮圖ASP.NET
- Android生成圖片並放入相簿Android
- activiti 生成當前任務圖片PNG
- php生成條形碼的圖片PHP
- 使用icomoon把svg圖片生成字型圖示SVG
- c#圖片生成png格式和原圖不同C#
- python使用pillow和opencv生成圖片縮圖PythonOpenCV
- Oracle 操作圖片 (轉)Oracle
- 擷取圖片生成頭像外掛
- 【日常筆記】生成驗證碼圖片筆記
- Python資料展示 - 生成表格圖片Python
- 聊聊excel生成圖片的幾種方式Excel
- 自定義Drawable:實現文字生成圖片
- 用python生成驗證碼圖片Python
- python生成漢字圖片字型檔Python
- JSP生成jpeg圖片用於投票JS
- 網店分類圖片生成軟體
- Android 合併生成分享圖片(View截圖)AndroidView
- 圖片載入失敗解決方案 以及canvas即時生成提示圖片Canvas
- html2canvas 如何生成高清圖片HTMLCanvas
- php qrcode不生成圖片怎麼辦PHP
- 用canvas生成圖片為頁面新增水印Canvas
- html2canvas生成圖片顯示不全HTMLCanvas
- htmlcanvas2 傳入節點生成圖片HTMLCanvas
- 完整的 java/kotlin 生成 echarts 圖片方法JavaKotlinEcharts
- Android 生成帶圖片的二維碼Android