<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    菠蘿三國

    大江東去,浪淘盡...
    隨筆 - 34, 文章 - 47, 評論 - 22, 引用 - 0
    數據加載中……

    C3P0連接池詳細配置(轉)

    <c3p0-config>
    <default-config>
    <!--當連接池中的連接耗盡的時候c3p0一次同時獲取的連接數。Default: 3 -->
    <property name="acquireIncrement">3</property>

    <!--定義在從數據庫獲取新連接失敗后重復嘗試的次數。Default: 30 -->
    <property name="acquireRetryAttempts">30</property>

    <!--兩次連接中間隔時間,單位毫秒。Default: 1000 -->
    <property name="acquireRetryDelay">1000</property>

    <!--連接關閉時默認將所有未提交的操作回滾。Default: false -->
    <property name="autoCommitOnClose">false</property>

    <!--c3p0將建一張名為Test的空表,并使用其自帶的查詢語句進行測試。如果定義了這個參數那么
    屬性preferredTestQuery將被忽略。你不能在這張Test表上進行任何操作,它將只供c3p0測試
    使用。Default: null-->
    <property name="automaticTestTable">Test</property>

    <!--獲取連接失敗將會引起所有等待連接池來獲取連接的線程拋出異常。但是數據源仍有效
    保留,并在下次調用getConnection()的時候繼續嘗試獲取連接。如果設為true,那么在嘗試
    獲取連接失敗后該數據源將申明已斷開并永久關閉。Default: false-->
    <property name="breakAfterAcquireFailure">false</property>

    <!--當連接池用完時客戶端調用getConnection()后等待獲取新連接的時間,超時后將拋出
    SQLException,如設為0則無限期等待。單位毫秒。Default: 0 -->
    <property name="checkoutTimeout">100</property>

    <!--通過實現ConnectionTester或QueryConnectionTester的類來測試連接。類名需制定全路徑。
    Default: com.mchange.v2.c3p0.impl.DefaultConnectionTester-->
    <property name="connectionTesterClassName"></property>

    <!--指定c3p0 libraries的路徑,如果(通常都是這樣)在本地即可獲得那么無需設置,默認null即可
    Default: null-->
    <property name="factoryClassLocation">null</property>

    <!--Strongly disrecommended. Setting this to true may lead to subtle and bizarre bugs.
    (文檔原文)作者強烈建議不使用的一個屬性-->
    <property name="forceIgnoreUnresolvedTransactions">false</property>

    <!--每60秒檢查所有連接池中的空閑連接。Default: 0 -->
    <property name="idleConnectionTestPeriod">60</property>

    <!--初始化時獲取三個連接,取值應在minPoolSize與maxPoolSize之間。Default: 3 -->
    <property name="initialPoolSize">3</property>

    <!--最大空閑時間,60秒內未使用則連接被丟棄。若為0則永不丟棄。Default: 0 -->
    <property name="maxIdleTime">60</property>

    <!--連接池中保留的最大連接數。Default: 15 -->
    <property name="maxPoolSize">15</property>

    <!--JDBC的標準參數,用以控制數據源內加載的PreparedStatements數量。但由于預緩存的statements
    屬于單個connection而不是整個連接池。所以設置這個參數需要考慮到多方面的因素。
    如果maxStatements與maxStatementsPerConnection均為0,則緩存被關閉。Default: 0-->
    <property name="maxStatements">100</property>

    <!--maxStatementsPerConnection定義了連接池內單個連接所擁有的最大緩存statements數。Default: 0 -->
    <property name="maxStatementsPerConnection"></property>

    <!--c3p0是異步操作的,緩慢的JDBC操作通過幫助進程完成。擴展這些操作可以有效的提升性能
    通過多線程實現多個操作同時被執行。Default: 3-->
    <property name="numHelperThreads">3</property>

    <!--當用戶調用getConnection()時使root用戶成為去獲取連接的用戶。主要用于連接池連接非c3p0
    的數據源時。Default: null-->
    <property name="overrideDefaultUser">root</property>

    <!--與overrideDefaultUser參數對應使用的一個參數。Default: null-->
    <property name="overrideDefaultPassword">password</property>

    <!--密碼。Default: null-->
    <property name="password"></property>

    <!--定義所有連接測試都執行的測試語句。在使用連接測試的情況下這個一顯著提高測試速度。注意:
    測試的表必須在初始數據源的時候就存在。Default: null-->
    <property name="preferredTestQuery">select id from test where id=1</property>

    <!--用戶修改系統配置參數執行前最多等待300秒。Default: 300 -->
    <property name="propertyCycle">300</property>

    <!--因性能消耗大請只在需要的時候使用它。如果設為true那么在每個connection提交的
    時候都將校驗其有效性。建議使用idleConnectionTestPeriod或automaticTestTable
    等方法來提升連接測試的性能。Default: false -->
    <property name="testConnectionOnCheckout">false</property>

    <!--如果設為true那么在取得連接的同時將校驗連接的有效性。Default: false -->
    <property name="testConnectionOnCheckin">true</property>

    <!--用戶名。Default: null-->
    <property name="user">root</property>

    <!--早期的c3p0版本對JDBC接口采用動態反射代理。在早期版本用途廣泛的情況下這個參數
    允許用戶恢復到動態反射代理以解決不穩定的故障。最新的非反射代理更快并且已經開始
    廣泛的被使用,所以這個參數未必有用。現在原先的動態反射與新的非反射代理同時受到
    支持,但今后可能的版本可能不支持動態反射代理。Default: false-->
    <property name="usesTraditionalReflectiveProxies">false</property>

    <property name="automaticTestTable">con_test</property>
    <property name="checkoutTimeout">30000</property>
    <property name="idleConnectionTestPeriod">30</property>
    <property name="initialPoolSize">10</property>
    <property name="maxIdleTime">30</property>
    <property name="maxPoolSize">25</property>
    <property name="minPoolSize">10</property>
    <property name="maxStatements">0</property>
    <user-overrides user="swaldman">
    </user-overrides>
    </default-config>
    <named-config name="dumbTestConfig">
    <property name="maxStatements">200</property>
    <user-overrides user="poop">
    <property name="maxStatements">300</property>
    </user-overrides>
    </named-config>
    </c3p0-config>

    posted @ 2008-01-18 11:58 菠蘿 閱讀(242) | 評論 (0)編輯 收藏

    修改jfreechart中的默認字體

    生成圖表后自動生成chart表的問題:

    我測試生成圖表中的中文問題都解決了,但是每次生成chart圖時會報UTF編碼錯誤,從錯誤判斷應該是某個文件的編碼錯誤,起初根據錯誤判斷是filter的問題,可是filter那點代碼中根本不涉及編碼的問題.我將很多配置文件的編碼都改了也不行.因為那個英文例子沒問題,我查看了JFreechart的一個servlet(org.jfree.chart.servlet.DisplayChart),因為jpviot就是調用這個servlet實現繪圖的,分析這個servlet我知道它會在一個臨時目錄生成png文件,然后交給servlet寫到瀏覽器的響應中去,我找到那個臨時目錄(tomcattemp),發現里面已經生成了正確的中文圖形.從而判斷圖形生成正確,但是寫到瀏覽器中時出了問題.最后我查看能生成英文圖表的那個例子,發覺不僅僅在html中生成圖形,而且生成map.而這個map的生成全是在程序中做的,程序生成一個xml文件,通過chart.xsl解析生成map的最終html代碼.但是在程序中生成時并沒有加入編碼設置,因此問題出在生成map這兒.

    最終修改代碼如下:

    com.tonbeller.jpivot.chart.ChartComponent:

    在render函數中修改如下:

    String desc="<?xml version="1.0" encoding="gb2312"?>";
    String xchart =desc+"n"+ "<xchart>" + writeImageMap(filename, info, false) + "</xchart>";
    這樣就為xchart設置了編碼.

    修改jfreechart中的默認字體:

    com.tonbeller.jpivot.chart.ChartComponent中定義了幾種字體,但是這幾種字體都是英文字體,我將其修改為宋體:
    把所有的字體定義都改為"SimSun"
    注意到這兒并沒有玩,如果你僅僅修改程序,仍舊會出現問題,報錯說沒有適合"SimSun"的item
    同時要修改一個配置文件:WEB-INFjpivotchartchartpropertiesform.xml
    在這個配置文件中將SimSun加入其中,形式如下:

    <listBox1 type="string" modelReference="fontName" label="Title font">
    <listItem value="SansSerif" label="SansSerif"/>
    <listItem value="Serif" label="Serif"/>
    <listItem value="SimSun" label="SimSun"/>
    <listItem value="Monospaced" label="Monospaced"/>
    </listBox1>

    posted @ 2008-01-14 12:20 菠蘿 閱讀(1250) | 評論 (0)編輯 收藏

    jfreechart在aix unix上的中文顯示問題

     

     

    今天開始搭建新的平臺,要把原來windows的應用遷移到Aix上,結果由于jfreechart的中文字體顯示耗了整個下午,好不郁悶,不過還好最后解決問題了:)
         
    主機環境:
     AIX Version 5.2 + Jboss4.03sp1 + J2RE 1.4.2 IBM AIX build ca142ifx-20050119
     使用jfreechart1.0rc

    添加啟動參數 -Djava.awt.headless=true才能正常顯示jfreechart的圖.

    讓jre使用中文字體的過程如下:

    1.解包字體文件
    TrueType_zhCN_GBK.tar,列表如下:
    fangsongti.ttf
    heiti.ttf
    kaiti.ttf
    songti.ttf
    注:字體包是我以前在solaris上整出來的.

    2.copy字體到jre的字體目錄${JAVA_HOME}/jre/lib/fonts


    3.修改JRE的字體配置
    3.1 修改fonts.scale文件[${JAVA_HOME}/jre/lib/fonts/fonts.scale]
    把一行的數字加4
    在文件尾添加
    fangsongti.ttf -zhongyi-fangsong-medium-r-normal--0-0-0-0-m-0-gbk-0
    heiti.ttf -zhongyi-hei-medium-r-normal--0-0-0-0-m-0-gbk-0
    kaiti.ttf -zhongyi-kai-medium-r-normal--0-0-0-0-m-0-gbk-0
    songti.ttf -zhongyi-song-medium-r-normal--0-0-0-0-m-0-gbk-0
    3.2 修改fonts.dir文件[${JAVA_HOME}/jre/lib/fonts/fonts.dir]
    把一行的數字加4
    在文件尾添加
    fangsongti.ttf -zhongyi-fangsong-medium-r-normal--0-0-0-0-m-0-gbk-0
    heiti.ttf -zhongyi-hei-medium-r-normal--0-0-0-0-m-0-gbk-0
    kaiti.ttf -zhongyi-kai-medium-r-normal--0-0-0-0-m-0-gbk-0
    songti.ttf -zhongyi-song-medium-r-normal--0-0-0-0-m-0-gbk-0
    3.3 修改font.properties.zh文件[${JAVA_HOME}/jre/lib/font.properties.zh]
    把所有的serif.1的值 進行如下替換
    -zhongyi-song-medium-r-normal--0-0-0-0-m-0-gbk-0


    4.重新啟動就可以了.

     

    其他的unix上我試了一下hp-unix,可以通過,其他的沒有試過,或許也可以吧:)

    posted @ 2008-01-14 12:18 菠蘿 閱讀(1119) | 評論 (9)編輯 收藏

    修改字體

    //X軸下標字體大小及顏色
    Axis axis1 = plot.getDomainAxis();
    axis1.setLabelFont(new Font("sansserf",Font.PLAIN,30));//字體
    axis1.setLabelPaint(Color.white);//顏色
     
    //X軸的字體顏色
    Axis axis = plot.getDomainAxis();
    axis.setTickLabelFont(new Font("Serif", Font.PLAIN,25));//字體
    axis.setTickLabelPaint(Color.white);//顏色 
     
    //Y軸字下標字體大小及顏色
    Axis axis2 = plot.getRangeAxis();
    axis2.setLabelFont(new Font("Serif", Font.PLAIN, 30));//字體  
    axis2.setLabelPaint(Color.white); //顏色
     
    //Y軸字體及顏色
    Axis axis3 = plot.getRangeAxis();
    axis3.setTickLabelFont(new Font("Serif", Font.PLAIN, 25));//字體  
    axis3.setTickLabelPaint(Color.white);//顏色
    

    posted @ 2008-01-14 12:10 菠蘿 閱讀(247) | 評論 (0)編輯 收藏

    WebBrowser.ExecWB方法

    WebBrowser.ExecWB(1,1) 打開
    WebBrowser.ExecWB(2,1) 關閉現在所有的IE窗口,并打開一個新窗口
    WebBrowser.ExecWB(4,1) 保存網頁
    WebBrowser.ExecWB(6,1) 打印
    WebBrowser.ExecWB(7,1) 打印預覽
    WebBrowser.ExecWB(8,1) 打印頁面設置
    WebBrowser.ExecWB(10,1) 查看頁面屬性
    WebBrowser.ExecWB(15,1) 好像是撤銷,有待確認
    WebBrowser.ExecWB(17,1) 全選
    WebBrowser.ExecWB(22,1) 刷新
    WebBrowser.ExecWB(45,1) 關閉窗體無提示

     

    其中最后一項WebBrowser.ExecWB(45,1)可以有效解決IE7下,使用

    WebBrowser.ExecWB(7,1)執行打印預覽后返回到原窗口時,window.close()方法失效的問題

    posted @ 2008-01-03 13:08 菠蘿 閱讀(1515) | 評論 (1)編輯 收藏

    iframe高度自適應(轉)

    <iframe name="src" width="100%" frameborder=0 scrolling=no src='admin.htm?catId=<c:out value="${model.l}" />'
            onload="this.height =   document.frames['src'].document.body.scrollHeight" />

    例子:
    1,創建頁面 test.html 。 頁面中含有一個 iframe,name為 ifrname ,id為 ifrid, src 為 iframe.html頁面。
    <iframe src="ifarme.html" name="ifrname" height="" style="" onload="" id="ifrid"   scrolling=""> </iframe>

    2,創建 iframe.html 頁面,里面含有一些內容。
    <p>
    這是iframe頁面,通過在父窗口頁面或子頁面添加JS來自動更改寬高,以適應內容的多少。
    </p>
    要想使iframe自動適應寬和高,可以在 test.html 頁面iframe onload處增加一些JS代碼。如:
       <iframe src="ifarme.html" name="ifrname" height="" style="" onload="this.height =   document.frames["ifrname"].document.body.scrollHeight" id="ifrid"   scrolling=""></iframe>

    這樣iframe即可以自動適應高度了。如果不在onload處增加js,那也可以放到頁面上來調用。比如寫個函數。
    <script>
    function setAutoHeight(iframeElement,   iframeWindow) {
    iframeElement.style.height = iframeWindow.document.body.scrollHeight;
    iframeElement.style.width   =   iframeWindow.document.body.scrollWidth   ;
    // 或者
    // iframeElement.height = iframeWindow.document.body.offsetHeight ;
    // iframeElement.width   =   iframeWindow.document.body.offsetWidth;

    }
    //調用函數setAutoHeight();
    setAutoHeight( document.getElementById("iframeid"), window.frames[0]   );
    </script>
    這樣也可以達到自適應高寬的目的,在這里要注意的是,iframeElement參數必須是 document.getElementById("iframeid"), iframeWindow參數是 window.frames[0] 或document.frames["ifrname"]。 這是因為通過name得到的對象是窗口(window)對象,非窗口里的iframe對象。同時document.getElementById("iframeid)不能像window對象可以得到window.document。
    所以這里最好給iframe分別加上name和id,id用來更改寬高樣式屬性,name用來執行window相關事件如location.href,document.write。bgColor例外,元素對象和窗口對象都可以得到,這是因為他們都有這個屬性。
    如果要隱藏iframe滾動條,可以設置iframeWindow.scrolling = "no";但這不能兼容多個瀏覽器,用iframeElement.document.body.style.overflow = "hidden";這種或直接在iframe處增加scrolling="no" html代碼就可以很好地兼容了。
    3,如果不能修改父頁面,而只能把代碼增加在iframe頁面里呢?
    可以寫個類似函數,放在iframe頁面里:
    <script>
    function setAutoHeight( parentIframeElement, slefDocument ){
    slefDocument.style.overflow = "hidden";           // 隱藏全部滾動條
    // document.body.style.overflowY = "hidden";   // 沒有豎滾動條
    parentIframeElement.style.height = slefDocument.scrollHeight;
    parentIframeElement.style.width   =   slefDocument.scrollWidth;
    }
    // 在頁面最后執行
    setAutoHeight(parent.document.getElementById("ifrid"), document.body);
    // 或onload時執行
    //window.onload = function() {
    //    setAutoHeight(parent.document.getElementById("ifrid"), document.body);
    //}
    // 或者超時執行
    // setTimeout(
    //    function() {
    //      setAutoHeight(parent.document.getElementById("ifrid"), document.body);
    //   },
    // 200 );
    </script>

    4,在線通過iframe更改父窗口里iframe的寬高,因為安全原因會有跨域的問題,若是不在同一域名,那是被禁止的。如果同在一個域名下,但2級域名不同,比如a.yourcompany.com 和b.yourcompany.com。
    這時可以通過重新設置document.domain 來跨越2級域名。
    var domain = "yourcompany.com";
    try {
        if( document.domain.indexOf(domain)   != -1 ) {
          document.domain = domain;                   // set new document.domain;
        }
    } catch (ex) {
        alert("error: " + ex.toString() );
    }
    如果域名含有yourcompany.com,則改將document.domain改為yourcompany.com

    posted @ 2007-12-03 12:28 菠蘿 閱讀(286) | 評論 (0)編輯 收藏

    高校ftp,密碼一百年不變

    高校ftp,密碼一百年不變.好東東不少~~
    高校ftp,密碼一百年不變.好東東不少,速度狂快(夸張點說是一百年,但現在還可以用的)
    ftp://smu:smc@218.5.241.10  主機:218.5.241.10 用戶名:smu 密碼: smc
    是教育網的,電信的可能很快,大家都來看看,里面很多軟件和電影
       
          看了,不要忘記跟貼哦。。。
    友情提示:下載后,請自行查毒!

    posted @ 2007-12-02 21:43 菠蘿 閱讀(353) | 評論 (0)編輯 收藏

    我的鏈接

    Tomcat專題
    http://www.chinaitlab.com/www/techspecial/tomcat/

    EXT
    http://www.dojochina.com/

    posted @ 2007-11-28 22:01 菠蘿 閱讀(144) | 評論 (0)編輯 收藏

    Aptana 插件

    Plugging Aptana into an existing Eclipse configuration

    From Aptana

    This page describes how to install into an existing Eclipse configuration.

    Contents

    [hide]

    Introduction

    If you are already an Eclipse user, you can install Aptana as a plug-in directly into your current Eclipse configuration.

    Instructions

    To plug Aptana (Milestone 8+) into an existing Eclipse (v3.2) configuration:

       

    1. From the Help menu in Eclipse, select Software Updates > Find and Install... to open an Install/Update pop-up window (shown below).

      Image:installUpdate.png

    2. On the Install/Update pop-up window, choose the Search for new features to install option, and click the Next button.
    3. Add a new remote site to add the Aptana plug-in:
      1. Click the New Remote Site... button to open a New Update Site pop-up window.
      2. On the New Update Site pop-up window, type Aptana in the site Name text box.
      3. In the URL text box, type the URL for the Aptana update site: http://update.aptana.com/install/3.2/ (shown below) and click OK.

        Image:updateAptana.png

      4. Click the Finish button to switch to the Updates window.
    4. On the Updates window, check the Aptana box (shown below), and click the Finish button.

      Image:includeAptana.png

    5. On the next screen, check the Aptana box, and click the Next button.
    6. Choose the option to accept the terms of the license agreement, and click the Next button.
    7. Click the Finish button.
    8. Click the Install All button.

       

     

    Eclipse installs the Aptana plug-in. To finish the installation process, follow the prompts to shut down and re-start Eclipse.

    To access all of Aptana's features as they are described in the Aptana documentation, you will need to change your Eclipse Perspective to the Aptana perspective. See Changing your Eclipse Perspective for instructions on how to change your Eclipse Perspective.


    Installing manually

    Download the latest release from http://update.aptana.com/install/3.2/ and follow the manual installation instructions on the page.

    Note: You may need to start Eclipse from the command-line with the "clean" option: eclipse -clean if the update didn't seem to work correctly.

    Related Topics

    Retrieved from "

    posted @ 2007-11-19 22:32 菠蘿 閱讀(1093) | 評論 (0)編輯 收藏

    vsftp500錯誤簡單解決方法

     

    cannot change directory:/home/***

    ftp服務器連接失敗,錯誤提示:
    500 OOPS: cannot change directory:/home/*******
    500 OOPS: child died
    解決方法:
     # setsebool ftpd_disable_trans 1
      # service vsftpd restart


    為避免每次開機都要作這個操作,可在setsebool命令后面加上-P選項,使改動永久有效。

    posted @ 2007-11-07 22:59 菠蘿 閱讀(600) | 評論 (0)編輯 收藏

    僅列出標題
    共4頁: 上一頁 1 2 3 4 下一頁 
    主站蜘蛛池模板: 国产一区二区三区免费视频| 久久亚洲私人国产精品vA| 久久国产亚洲精品| 成人免费毛片内射美女-百度| 97亚洲熟妇自偷自拍另类图片| 亚洲国产精品不卡在线电影| 中文字幕亚洲色图| 久久综合九色综合97免费下载| 亚洲色婷婷六月亚洲婷婷6月| 在线亚洲高清揄拍自拍一品区| 四虎最新永久免费视频| 色老板亚洲视频免在线观| 一级女人18片毛片免费视频| 3344免费播放观看视频| 久久亚洲精品中文字幕| 91免费播放人人爽人人快乐| 亚洲愉拍一区二区三区| 亚洲成年看片在线观看| 亚洲午夜在线一区| 99在线热播精品免费99热| 无码乱人伦一区二区亚洲一| 免费观看美女用震蛋喷水的视频| 91亚洲视频在线观看| 日本高清免费aaaaa大片视频| 美景之屋4在线未删减免费| 久久久久亚洲AV无码专区网站| 成人精品一区二区三区不卡免费看| 亚洲视频在线免费看| 大香人蕉免费视频75| 亚洲免费在线播放| 噼里啪啦电影在线观看免费高清 | 亚洲AV无码一区二区二三区软件 | 国产亚洲情侣一区二区无| 午夜理伦剧场免费| 亚洲Av永久无码精品黑人 | 黄色毛片免费网站| 亚洲av日韩av无码| 老司机永久免费网站在线观看| 亚洲自国产拍揄拍| 亚洲精品99久久久久中文字幕| 久久99国产综合精品免费|