- Oct 27 Fri 2006 09:41
-
[新奇]訂便當系統
- Aug 30 Tue 2005 11:57
-
Copy a file
Copy a file [JDK1.4 using the java.nio package]
import java.io.*; public class JCopy{ public static void main(String args[]){ try { JCopy j = new JCopy(); j.copyFile(new File(args[0]),new File(args[1])); } catch (Exception e) { e.printStackTrace(); } } public void copyFile(File in, File out) throws Exception { FileInputStream fis = new FileInputStream(in); FileOutputStream fos = new FileOutputStream(out); byte[] buf = new byte[1024]; int i = 0; while((i=fis.read(buf))!=-1) { fos.write(buf, 0, i); } fis.close(); fos.close(); } } import java.nio.channels.*; import java.io.*; public class JCopy2{ public static void main(String args[]){ try { JCopy2 j = new JCopy2(); j.copyFile(new File(args[0]),new File(args[1])); } catch (Exception e) { e.printStackTrace(); } } public void copyFile(File in, File out) throws Exception { FileChannel sourceChannel = new FileInputStream(in).getChannel(); FileChannel destinationChannel = new FileOutputStream(out).getChannel(); sourceChannel.transferTo(0, sourceChannel.size(), destinationChannel); // or // destinationChannel.transferFrom(sourceChannel, 0, sourceChannel.size()); sourceChannel.close(); destinationChannel.close(); } } - Aug 01 Mon 2005 18:24
-
XStream
- Jun 07 Tue 2005 15:12
-
Struts VS Turbine
Struts VS Turbine
轉載自
http://www.cn-java.com/target/news.php?news_id=2335
Struts 和 Turbine 我都用過並且做過項目,我想在這個問題上我還是有點發言權的:-)
Struts 比 Turbine 的結構簡單多了,換而言之,Struts 是一個非常純的 Web Framework,它也僅僅只是一個 Framework.Struts 的官方定義中說了其符合 MVC,我並不是非常認同.Struts 很好的完成了 VC(Visual & Control),但它並沒有提供相應的M(Module),或者說不明顯.Struts 最好的搭檔可能就是 EJB 了,因為 EJB 補充了它的 M.
轉載自
http://www.cn-java.com/target/news.php?news_id=2335
Struts 和 Turbine 我都用過並且做過項目,我想在這個問題上我還是有點發言權的:-)
Struts 比 Turbine 的結構簡單多了,換而言之,Struts 是一個非常純的 Web Framework,它也僅僅只是一個 Framework.Struts 的官方定義中說了其符合 MVC,我並不是非常認同.Struts 很好的完成了 VC(Visual & Control),但它並沒有提供相應的M(Module),或者說不明顯.Struts 最好的搭檔可能就是 EJB 了,因為 EJB 補充了它的 M.
- Jun 07 Tue 2005 14:49
-
Velocity
Velocity
偶然在網路上發現這個名詞,不知道之後會不會成為主流的技術之一
官方網站
http://jakarta.apache.org/velocity/index.html
user-guide(english)
偶然在網路上發現這個名詞,不知道之後會不會成為主流的技術之一
官方網站
http://jakarta.apache.org/velocity/index.html
user-guide(english)
- Jan 24 Mon 2005 10:51
-
java_util容器用法的整理

l 其中:
Collections => Collection是所有List跟Set的始祖,List必須以特定次序來持有物件,Set無法擁有重複元素
========================
ArrayList => 用Array實做的List,允許快速隨機存取,相較於LinkedList 不適合拿來進行元素安插和移除動作
- Jan 21 Fri 2005 14:28
-
SQL Data Type 與 Java class 對應表
SQL Data Type 與 Java class 對應表
SQL Type Java class
-------------------------------------------
CHAR java.lang.String
-------------------------------------------
SQL Type Java class
-------------------------------------------
CHAR java.lang.String
-------------------------------------------
- Jan 21 Fri 2005 14:26
-
Java 使用 Mysql 時的中文處理
連接 Mysql Database Server:
-------------------------------------------------------------------------------
mysql 不支持 unicode,所以比較麻煩。
先將 URL String 設置成 encoding 為 Big5
String url = "jdbc:mysql://localhost/test?useUnicode=true&characterEncoding=Big5";
-------------------------------------------------------------------------------
mysql 不支持 unicode,所以比較麻煩。
先將 URL String 設置成 encoding 為 Big5
String url = "jdbc:mysql://localhost/test?useUnicode=true&characterEncoding=Big5";
- Jan 21 Fri 2005 14:24
-
sendRedirect與requestDispatcher的限制
Java Web 程式設計 sendRedirect與requestDispatcher的限制
1. RequestDispatcher限制
當於程式中使用以下敘述
PrintWriter out = response.getWriter();
1. RequestDispatcher限制
當於程式中使用以下敘述
PrintWriter out = response.getWriter();
1