锘??xml version="1.0" encoding="utf-8" standalone="yes"?>1024精品一区二区三区,污污的网站在线观看,亚洲在线播放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>