發現java中容器遍曆的一個很方便方法比如有一個vector<string> vec;要遍曆該容器中的每一個元素,最簡單的方法可以用for(int i =0; i< vec.size(); i++){ do something on vec.elementat(i)}更簡單的寫法就是for (String temp : vec) {do something on
爬蟲程式運行中出現異常,java.net.SocketException: No buffer space available (maximum connections reached?): JVM_Bin爬蟲中使用httpclient,而且是使用了線程池。搜了下發現,別人也有類似問題,解決辦法如下,照著改了下程式,看看以後運行中是否還會出現這個問題。 from http://9iopen.group.javaeye.com/group/blog/144545 在一個爬蟲程式中遇到了以下異常:
文章目錄 1.更新到資料庫的文字欄位使用ResultSet的updateBytes方法使用String的getBytes方法2.從資料庫欄位讀取文本使用String類的建構函式1.更新到資料庫的文字欄位使用ResultSet的updateBytes方法使用String的getBytes方法2.從資料庫欄位讀取文本使用String類的建構函式 from
org.apache.ibatis.builder.IncompleteElementException: Could not find result map java.lang.Integer at org.apache.ibatis.builder.MapperBuilderAssistant.setStatementResultMap(MapperBuilderAssistant.java:354) at
This happens when you write to a TCP connection that has already beenclosed by the reading end. Depending on your application, you wouldeither treat it as an application protocol error or ignore it and giveup. In either case the socket is almost
java.io.CharConversionException: Not an ISO 8859-1 character: XXX這個問題可能是因為outputstream輸出中文字造成的影響。response.setContentType("text/html;charset=UTF-8");//response.getOutputStream().print("中文字"); //這行會出錯response.getWriter().print("中文字");