摘要: Sun has rolled out the Temple of Sun Contest with a US$5,000 cash prize. This is a great vehicle to promote Sun Studio on campus. 閱讀全文
摘要: ANT是一個基于JAVA的自動化腳本引擎,腳本格式為XML。除了做JAVA編譯相關任務外,ANT還可以通過插件實現很多應用的調用。 閱讀全文
摘要: 軟件開發習慣中一個細微更改都可能會對軟件質量產生巨大改進。將單元測試合并到開發過程中,然后從長遠角度來看它可以節省多少時間和精力。本文通過使用代碼樣本說明了單元測試的種種好處,特別是使用 Ant 和 JUnit 帶來的各種方便。 閱讀全文
摘要: 在Ant出現之前,構建和部署Java應用需要使用包括特定平臺的腳本、Make文件、各種版本的IDE甚至手工操作的“大雜燴”。現在,幾乎所有的開源 Java項目都在使用Ant,大多數公司的內部項目也在使用Ant。Ant在這些項目中的廣泛使用自然導致了讀者對一整套Ant最佳實踐的迫切需求。 閱讀全文
摘要: By the way,there is a tool,Sun Device Detection Tool ,which is based on jnlp protocol, can tell us in just a few minutes whether the Solaris OS supports the devices that are detected in our x86 system, in advance. 閱讀全文
摘要: 昨晚同學找我幫忙寫一個利用GOOGLE API的小程序,也比較感興趣所以就應下了。下載了GOOGLE提供的googleapi.jar,大約花了20多分鐘,寫了這個小程序,由于需要提供GOOGLE key所以也懶得去申請,就沒有測試~~呵呵 閱讀全文
摘要: 元數據是利用JDBC創建和操作數據庫對象的一個很重要的概念和應用,所以今天我特地的找了一些詳細解析個概念的資料,和利用java來操作的實例。 閱讀全文
出于java的安全限制,System.getProperty("line.seperator")是不能夠直接取得的。可以這樣做:
摘要: 可供程序利用的資源(內存、CPU時間、網絡帶寬等)是有限的,優化的目的就是讓程序用盡可能少的資源完成預定的任務。優化通常包含兩方面的內容:減小代碼的體積,提高代碼的運行效率。本文討論的主要是如何提高代碼的效率。 閱讀全文 1.變量引用的時候,空指針情況的防止,即為空檢查.
2.數學運算異常,如除0的情況.數組越界異常,字符串訪問過界
3.數據庫檢索記錄,結果記錄行數狀況的處理.
4.畫面顯示項目的確認.
5.畫面顯示項目達到上限時情況的處理.
6.系統出錯的時候,異常信息是否正確.
7.數據庫連接,游標的處理.
8.數學運算時,數據精度的處理.
String lineSeparator = (String) java.security.AccessController.doPrivileged(
new sun.security.action.GetPropertyAction("line.separator"));
具體參考java.io.BufferedWriter的源代碼就可以找到上面這行代碼。 DriverManager里也有new sun.security.action.GetPropertyAction("line.separator"));
1 private static void loadInitialDrivers() {
2 String drivers;
3
4 try {
5 drivers = (String) java.security.AccessController
6 .doPrivileged(new sun.security.action.GetPropertyAction(
7 "jdbc.drivers"));
8 } catch (Exception ex) {
9 drivers = null;
10 }
11 println("DriverManager.initialize: jdbc.drivers = " + drivers);
12 if (drivers == null) {
13 return;
14 }
15 while (drivers.length() != 0) {
16 int x = drivers.indexOf(':');
17 String driver;
18 if (x < 0) {
19 driver = drivers;
20 drivers = "";
21 } else {
22 driver = drivers.substring(0, x);
23 drivers = drivers.substring(x + 1);
24 }
25 if (driver.length() == 0) {
26 continue;
27 }
28 try {
29 println("DriverManager.Initialize: loading " + driver);
30 Class.forName(driver, true, ClassLoader.getSystemClassLoader());
31 } catch (Exception ex) {
32 println("DriverManager.Initialize: load failed: " + ex);
33 }
34 }
35 }
sun.security.action.GetPropertyAction() hasn't been publiced.actually and exactly,it's not be doced,which reflects that sun doesn't surport us to use these class or method which is lower class,usually, we use the classes api tells us is proier and maybe has called these undoc class but usually for us ,it's not necessary.so in the program of us or even others ,we could and i think it's really better for us to neglect them which u can find out in the jar file of rt.jar.2 String drivers;
3
4 try {
5 drivers = (String) java.security.AccessController
6 .doPrivileged(new sun.security.action.GetPropertyAction(
7 "jdbc.drivers"));
8 } catch (Exception ex) {
9 drivers = null;
10 }
11 println("DriverManager.initialize: jdbc.drivers = " + drivers);
12 if (drivers == null) {
13 return;
14 }
15 while (drivers.length() != 0) {
16 int x = drivers.indexOf(':');
17 String driver;
18 if (x < 0) {
19 driver = drivers;
20 drivers = "";
21 } else {
22 driver = drivers.substring(0, x);
23 drivers = drivers.substring(x + 1);
24 }
25 if (driver.length() == 0) {
26 continue;
27 }
28 try {
29 println("DriverManager.Initialize: loading " + driver);
30 Class.forName(driver, true, ClassLoader.getSystemClassLoader());
31 } catch (Exception ex) {
32 println("DriverManager.Initialize: load failed: " + ex);
33 }
34 }
35 }
摘要: 可供程序利用的資源(內存、CPU時間、網絡帶寬等)是有限的,優化的目的就是讓程序用盡可能少的資源完成預定的任務。優化通常包含兩方面的內容:減小代碼的體積,提高代碼的運行效率。本文討論的主要是如何提高代碼的效率。 閱讀全文 1.變量引用的時候,空指針情況的防止,即為空檢查.
2.數學運算異常,如除0的情況.數組越界異常,字符串訪問過界
3.數據庫檢索記錄,結果記錄行數狀況的處理.
4.畫面顯示項目的確認.
5.畫面顯示項目達到上限時情況的處理.
6.系統出錯的時候,異常信息是否正確.
7.數據庫連接,游標的處理.
8.數學運算時,數據精度的處理.
| |||||||||
日 | 一 | 二 | 三 | 四 | 五 | 六 | |||
---|---|---|---|---|---|---|---|---|---|
27 | 28 | 29 | 30 | 1 | 2 | 3 | |||
4 | 5 | 6 | 7 | 8 | 9 | 10 | |||
11 | 12 | 13 | 14 | 15 | 16 | 17 | |||
18 | 19 | 20 | 21 | 22 | 23 | 24 | |||
25 | 26 | 27 | 28 | 29 | 30 | 31 | |||
1 | 2 | 3 | 4 | 5 | 6 | 7 |
常用鏈接
留言簿(10)
隨筆分類(95)
- Data Structure && Algorithm (14)
- IBM Tech(8)
- No Category(11)
- Personal Comments(12)
- python(2)
- Simple Java(31)
- SUN Tech(17)
隨筆檔案(97)
- 2009年9月 (1)
- 2008年8月 (1)
- 2008年7月 (2)
- 2008年4月 (3)
- 2008年2月 (2)
- 2008年1月 (1)
- 2007年12月 (3)
- 2007年11月 (3)
- 2007年10月 (7)
- 2007年8月 (2)
- 2007年7月 (5)
- 2007年6月 (1)
- 2007年5月 (8)
- 2007年4月 (15)
- 2007年3月 (9)
- 2007年2月 (2)
- 2007年1月 (3)
- 2006年12月 (6)
- 2006年11月 (2)
- 2006年10月 (5)
- 2006年8月 (2)
- 2006年7月 (5)
- 2006年5月 (9)
文章檔案(10)
相冊
J2ME技術網站
java技術相關
mess
搜索
最新評論

- 1.?re: SWT JFACE .TreeViewer Expand事件及其節點處理方法[未登錄]
-
@求助
非常感謝 解決了問題 - --huhu
- 2.?re: The Fifth Discipline Peter M. Senge(彼得·圣潔)
-
@Scott
- --bc05002@gmail.com
- 3.?re: Java6 MUstang新特性總結(摘錄)
- Thanks for your sharing.I like it very much, thanks!
- --ed hardy
- 4.?re: F3(轉http://blogs.sun.com/chrisoliver/entry/f3)
- 評論內容較長,點擊標題查看
- --runescape gold
- 5.?re: ideas are just a multiplier of execution(copied)
- 評論內容較長,點擊標題查看
- --James07