锘??xml version="1.0" encoding="utf-8" standalone="yes"?>国产资源在线看,精品一区二区在线看,亚洲人免费视频http://www.aygfsteel.com/liuyxit/category/48876.html鍏變韓閰搞佺敎銆佽嫤銆佽荊zh-cnWed, 24 Aug 2011 09:08:32 GMTWed, 24 Aug 2011 09:08:32 GMT60Eclipse甯哥敤鎻掍歡瀹夎鍦板潃http://www.aygfsteel.com/liuyxit/archive/2011/08/16/356621.html涓夊垁嫻併伄閫嗛涓夊垁嫻併伄閫嗛Tue, 16 Aug 2011 04:16:00 GMThttp://www.aygfsteel.com/liuyxit/archive/2011/08/16/356621.htmlhttp://www.aygfsteel.com/liuyxit/comments/356621.htmlhttp://www.aygfsteel.com/liuyxit/archive/2011/08/16/356621.html#Feedback0http://www.aygfsteel.com/liuyxit/comments/commentRss/356621.htmlhttp://www.aygfsteel.com/liuyxit/services/trackbacks/356621.html

涓夊垁嫻併伄閫嗛 2011-08-16 12:16 鍙戣〃璇勮
]]>
mysql,sqlserver,oracle涓夌鏁版嵁搴撶殑澶у璞″瓨鍙?/title><link>http://www.aygfsteel.com/liuyxit/archive/2011/06/19/352605.html</link><dc:creator>涓夊垁嫻併伄閫嗛</dc:creator><author>涓夊垁嫻併伄閫嗛</author><pubDate>Sat, 18 Jun 2011 18:02:00 GMT</pubDate><guid>http://www.aygfsteel.com/liuyxit/archive/2011/06/19/352605.html</guid><wfw:comment>http://www.aygfsteel.com/liuyxit/comments/352605.html</wfw:comment><comments>http://www.aygfsteel.com/liuyxit/archive/2011/06/19/352605.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/liuyxit/comments/commentRss/352605.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/liuyxit/services/trackbacks/352605.html</trackback:ping><description><![CDATA[mysql 澶у璞″瓨鍙? 綾誨瀷涓鑸簲璇ョ敤mediumblod, blob鍙兘瀛?鐨?6嬈℃柟涓猙yte, mediumblod鏄?4嬈℃柟, 涓鑸潵璇村鐢ㄤ簡.longblob鏄?2嬈℃柟鏈変簺澶? MYSQL榛樿閰嶇疆鍙兘瀛?M澶у皬鐨勬枃浠?瑕佷慨鏀歸厤緗?WIN鐗堟湰鐨勫湪mysql.ini鏂囦歡涓? 淇敼max_allowed_packet,net_buffer_length絳夊嚑涓弬鏁?鎴栫洿鎺ET GLOBAL varName=value. linux鐗堟湰鍙互鍦ㄥ惎鍔ㄥ弬鏁板悗鍔?max_allowed_packet=xxM絳夊嚑涓弬鏁? MYSQL瀛樺ぇ瀵硅薄鏈濂界洿鎺ュ氨setBinaryStream,鍙堝揩鍙堟柟渚? 鑰屼笉瑕佸厛鎻掑叆絀哄啀閫犲瀷鎴怋LOB鐒跺悗鍐峴etBlob 渚嬪瓙: import java.sql.*; import java.io.*; public class DBTest { static String driver = "org.gjt.mm.mysql.Driver"; static String url = "jdbc:mysql://localhost:3306/test"; static String user = "root"; static String passwd = "passwd"; public static void main(String[] args) throws Exception { Connection conn = null; try { Class.forName(driver); conn = DriverManager.getConnection(url,user,passwd); int op = 1; //鎻掑叆 if (op == 0) { PreparedStatement ps = conn.prepareStatement("insert into tb_file values (?,?)"); ps.setString(1, "aaa.exe"); InputStream in = new FileInputStream("d:/aaa.exe"); ps.setBinaryStream(2,in,in.available()); ps.executeUpdate(); ps.close(); } else { //鍙栧嚭 PreparedStatement ps = conn.prepareStatement("select * from tb_file where filename = ?"); ps.setString(1, "aaa.exe"); ResultSet rs = ps.executeQuery(); rs.next(); InputStream in = rs.getBinaryStream("filecontent"); System.out.println(in.available()); FileOutputStream out = new FileOutputStream("d:/bbb.exe"); byte[] b = new byte[1024]; int len = 0; while ( (len = in.read(b)) != -1) { out.write(b, 0, len); out.flush(); } out.close(); in.close(); rs.close(); ps.close(); } } catch (Exception ex) { ex.printStackTrace(System.out); } finally { try {conn.close();} catch (Exception ex) { } } } } sqlserver 澶у璞″瓨鍙栨病鏈変粈涔堝璇寸殑,鍙鏄痠mage綾誨瀷灝辮浜?娉ㄦ剰榪欐槸column綾誨瀷,鏈変漢浠ヤ負瀹冨彧鑳藉瓨 鍥捐薄.image鏄枃浠墮暅璞$殑鎰忔? import java.sql.*; import java.io.*; public class DBTest { static String driver = "com.microsoft.jdbc.sqlserver.SQLServerDriver"; static String url = "jdbc:microsoft:sqlserver://192.168.0.202:9999999999;DatabaseName=dddd"; static String user = "sa"; static String passwd = "ps"; public static void main(String[] args) throws Exception { Connection conn = null; try { Class.forName(driver); conn = DriverManager.getConnection(url,user,passwd); int op = 0; //鎻掑叆 if (op == 0) { PreparedStatement ps = conn.prepareStatement("insert into tb_file values (?,?)"); ps.setString(1, "aaa.exe"); InputStream in = new FileInputStream("d:/aaa.exe"); ps.setBinaryStream(2,in,in.available()); ps.executeUpdate(); ps.close(); } else { //鍙栧嚭 PreparedStatement ps = conn.prepareStatement("select * from tb_file where filename = ?"); ps.setString(1, "aaa.exe"); ResultSet rs = ps.executeQuery(); rs.next(); InputStream in = rs.getBinaryStream("filecontent"); System.out.println(in.available()); FileOutputStream out = new FileOutputStream("d:/bbb.exe"); byte[] b = new byte[1024]; int len = 0; while ( (len = in.read(b)) != -1) { out.write(b, 0, len); out.flush(); } out.close(); in.close(); rs.close(); ps.close(); } } catch (Exception ex) { ex.printStackTrace(System.out); } finally { try {conn.close();} catch (Exception ex) { } } } } ORACLE鐨勫ぇ瀵硅薄瀛樺偍鏈変簺鍙樻?瑕佹棤璁烘槸Blob,榪樻槸CLOB閮借姹傚厛鎻掑叆涓涓┖鍊?鐒跺悗 鏌ヨ騫墮攣瀹氳繖涓鏉¤褰?鑾峰彇瀵筁ob鐨勫紩鐢ㄥ啀榪涜濉厖,緗戜笂鏈夊お澶氱殑渚嬪瓙.鎴戜釜浜鴻涓? 榪欑鏂規硶鍨冨溇寰楄繛鍐欓兘涓嶆兂鍐欎簡,浣犲彲浠ヨ嚜宸卞幓鎼滅儲涓涓? 榪欑鐗瑰埆鐨勬搷浣滄棦澧炲姞鎿嶄綔鐨勫鏉傚害,鍙堣繚鍙嶄簡JDBC鎺ュ彛鐨勮鑼?鎵浠ユ垜鏋佸姏鍙嶅榪欐牱 浣跨敤,濡傛灉浣犲拰鎴戞湁鍚屾牱鐨勮鐐?閭d箞鎴戞彁渚涘彟涓縐嶉氱敤鐨勬柟娉?灝辨槸浣犱笉鐢↙OB鑰岀敤 oracle鐨凩ONG RAW鏉ヤ唬鏇垮畠浠?榪欐牱灝卞彲浠ヨ薄鍏跺畠瀵硅薄涓鏍鋒搷浣滀簡: create table tb_file(filename varchar2(255),filecontent LONG RAW); import java.sql.*; import java.io.*; public class BlobTest { static String driver = "oracle.jdbc.driver.OracleDriver"; static String url = "jdbc:oracle:thin:@localhost:1521:test"; static String user = "system"; static String passwd = "passwd"; public static void main(String[] args) throws Exception { Connection conn = null; try { Class.forName(driver); conn = DriverManager.getConnection(url, user, passwd); int op = 1; //鎻掑叆 if (op == 0) { PreparedStatement ps = conn.prepareStatement("insert into tb_file values (?,?)"); ps.setString(1, "aaa.exe"); InputStream in = new FileInputStream("d:/aaa.exe"); ps.setBinaryStream(2,in,in.available()); ps.executeUpdate(); ps.close(); } else { //鍙栧嚭 PreparedStatement ps = conn.prepareStatement("select * from tb_file where filename = ?"); ps.setString(1, "aaa.exe"); ResultSet rs = ps.executeQuery(); rs.next(); InputStream in = rs.getBinaryStream("filecontent"); System.out.println(in.available()); FileOutputStream out = new FileOutputStream("d:/bbb.exe"); byte[] b = new byte[1024]; int len = 0; while ( (len = in.read(b)) != -1) { out.write(b, 0, len); out.flush(); } out.close(); in.close(); rs.close(); ps.close(); } } catch (Exception ex) { ex.printStackTrace(System.out); } finally { try { conn.close(); } catch (Exception ex) {} } } } 杞嚜錛歨ttp://dev.csdn.net/author/axman/1ca2ede425e44dba9ac20c2e262e4fb8.html <img src ="http://www.aygfsteel.com/liuyxit/aggbug/352605.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/liuyxit/" target="_blank">涓夊垁嫻併伄閫嗛</a> 2011-06-19 02:02 <a href="http://www.aygfsteel.com/liuyxit/archive/2011/06/19/352605.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>[杞琞inputStream涓巄yte[]浜掕漿銆?/title><link>http://www.aygfsteel.com/liuyxit/archive/2011/06/19/inputStream_byte.html</link><dc:creator>涓夊垁嫻併伄閫嗛</dc:creator><author>涓夊垁嫻併伄閫嗛</author><pubDate>Sat, 18 Jun 2011 18:01:00 GMT</pubDate><guid>http://www.aygfsteel.com/liuyxit/archive/2011/06/19/inputStream_byte.html</guid><wfw:comment>http://www.aygfsteel.com/liuyxit/comments/352604.html</wfw:comment><comments>http://www.aygfsteel.com/liuyxit/archive/2011/06/19/inputStream_byte.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/liuyxit/comments/commentRss/352604.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/liuyxit/services/trackbacks/352604.html</trackback:ping><description><![CDATA[import java.io.ByteArrayOutputStream; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; public class FileByteUtil { public static void main(String[] args) throws Exception { File file=new File( "f:/test.doc "); byte[] fileByte = file2byte(file); byte2file(fileByte, "f:/test2.doc "); } public static byte[] file2byte(File f) throws Exception { return file2byte(f.getPath()); } public static byte[] file2byte(String f) throws Exception { try { InputStream in = new FileInputStream(f); byte[] tmp = new byte[512]; ByteArrayOutputStream out = new ByteArrayOutputStream(); int bytesRead = in.read(tmp); while (bytesRead != -1) { out.write(tmp, 0, bytesRead); bytesRead = in.read(tmp); } return out.toByteArray(); } catch (Exception e) { e.printStackTrace(); } return null; } // writes byte [] to a file public static void byte2file(byte[] data, String fn) throws Exception { try { OutputStream out = new FileOutputStream(fn); out.write(data); out.flush(); } catch (FileNotFoundException e) { throw e; } catch (IOException e) { throw e; } } }<img src ="http://www.aygfsteel.com/liuyxit/aggbug/352604.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/liuyxit/" target="_blank">涓夊垁嫻併伄閫嗛</a> 2011-06-19 02:01 <a href="http://www.aygfsteel.com/liuyxit/archive/2011/06/19/inputStream_byte.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item></channel></rss> <footer> <div class="friendship-link"> <a href="http://www.aygfsteel.com/" title="狠狠久久亚洲欧美专区_中文字幕亚洲综合久久202_国产精品亚洲第五区在线_日本免费网站视频">狠狠久久亚洲欧美专区_中文字幕亚洲综合久久202_国产精品亚洲第五区在线_日本免费网站视频</a> </div> </footer> 主站蜘蛛池模板: <a href="http://" target="_blank">夹江县</a>| <a href="http://" target="_blank">甘肃省</a>| <a href="http://" target="_blank">陵川县</a>| <a href="http://" target="_blank">瑞丽市</a>| <a href="http://" target="_blank">阳曲县</a>| <a href="http://" target="_blank">周至县</a>| <a href="http://" target="_blank">醴陵市</a>| <a href="http://" target="_blank">武义县</a>| <a href="http://" target="_blank">景洪市</a>| <a href="http://" target="_blank">河间市</a>| <a href="http://" target="_blank">甘泉县</a>| <a href="http://" target="_blank">石柱</a>| <a href="http://" target="_blank">景德镇市</a>| <a href="http://" target="_blank">日喀则市</a>| <a href="http://" target="_blank">石家庄市</a>| <a href="http://" target="_blank">新民市</a>| <a href="http://" target="_blank">上犹县</a>| <a href="http://" target="_blank">兴国县</a>| <a href="http://" target="_blank">张家港市</a>| <a href="http://" target="_blank">抚州市</a>| <a href="http://" target="_blank">东阳市</a>| <a href="http://" target="_blank">茌平县</a>| <a href="http://" target="_blank">扶沟县</a>| <a href="http://" target="_blank">永丰县</a>| <a href="http://" target="_blank">武夷山市</a>| <a href="http://" target="_blank">肇源县</a>| <a href="http://" target="_blank">葫芦岛市</a>| <a href="http://" target="_blank">武强县</a>| <a href="http://" target="_blank">富蕴县</a>| <a href="http://" target="_blank">理塘县</a>| <a href="http://" target="_blank">五河县</a>| <a href="http://" target="_blank">通海县</a>| <a href="http://" target="_blank">南康市</a>| <a href="http://" target="_blank">黄龙县</a>| <a href="http://" target="_blank">资溪县</a>| <a href="http://" target="_blank">眉山市</a>| <a href="http://" target="_blank">竹北市</a>| <a href="http://" target="_blank">庆元县</a>| <a href="http://" target="_blank">方城县</a>| <a href="http://" target="_blank">永胜县</a>| <a href="http://" target="_blank">青龙</a>| <script> (function(){ var bp = document.createElement('script'); var curProtocol = window.location.protocol.split(':')[0]; if (curProtocol === 'https') { bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; } else { bp.src = 'http://push.zhanzhang.baidu.com/push.js'; } var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(bp, s); })(); </script> </body>