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

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

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

    posts - 33, comments - 46, trackbacks - 0, articles - 2

    已經有一段時間了,經過半天時間的多次嘗試,還是沒能在redhat EL6上面安裝成功oracle 10g,雖然說該版本的oracle沒有在經過redhat el6的認證,但是網絡上還是可以找到不少相關的文章好像是可以安裝成功的,不過通過這次嘗試,也獲得不少相關當面的經驗,那就是接下來重裝為CentOS5.5,然后安裝Oracle 10g,一次成功,1個小時內完成,呵呵。

    接下來再記錄一下相關的一些資料

    posted @ 2011-12-28 11:59 在路上... 閱讀(299) | 評論 (0)編輯 收藏

    為了安裝軟件包方便,通常需要配置使用yum來安裝,或者在機房里面,不能使用互聯網的時候,不希望使用rpm來安裝,如何配置等等問題,為了方便以后使用,記錄下備忘:

    1、基于ISO安裝包的repo配置

    首先需要將iso文件mount起來,可以使用mount –o loop /FILE_TO_DVD.iso /mnt/cdrom

    進入yum repo目錄:/etc/yum.repos.d,編輯一個文件iso.repo

    [root@linux yum.repos.d]# cat iso.repo
    [iso]
    name=iso
    baseurl=file:///mnt/cdrom
    gpgkey=file:///mnt/cdrom/RPM-GPG-KEY-beta
    gpgcheck=0

    把原來的文件CentOS-Base.repo  CentOS-Media.repo可以加個.bak擴展名備份一下。
    或者可以使用參數
    yum --disablerepo=* --enablerepo=iso
    控制不同的repo使用

    接下來安裝軟件就可以方便的使用類似這樣的命令安裝了
    yum install glibc

    使用yum list可以測試一下是否包含了剛才的軟件庫,或者可以使用'yum clean all' 清除metadata

    2、配置yum代理

    可以修改/etc/yum.conf 文件,加入:

    # 代理服務器 - proxy server:port number
    proxy=http://mycache.mydomain.com:3128
    # 用于 yum 連接的帳戶細節
    proxy_username=yum-user
    proxy_password=pass

    或者可以通過環境變量加入當前用戶的全局代理,可以修改.bash_profile文件:

    http_proxy="http://yum-user:qwerty@mycache.mydomain.com:3128"
    export http_proxy

    posted @ 2011-12-28 11:50 在路上... 閱讀(371) | 評論 (0)編輯 收藏

    測試發帖,直接粘貼圖片看看效果如何!

    image

    posted @ 2011-07-30 09:31 在路上... 閱讀(270) | 評論 (0)編輯 收藏

    通過下面方式可以發布jboss的naming服務
    <?xml version="1.0" encoding="UTF-8"?>
    <server>
      
    <mbean code="org.jboss.naming.NamingService" 
             name
    ="DefaultDomain:service=Naming">
        
    <attribute name="Port">1099</attribute>
      
    </mbean>
    </server>


    同時也可以獨立使用,你需要jnpserver.jarlog4j.jar 文件,
     # Use a ConsoleAppender -- write log data to standard out
    log4j.rootLogger
    =DEBUG, A1
    log4j.appender.A1
    =org.apache.log4j.ConsoleAppender
    log4j.appender.A1.layout
    =org.apache.log4j.PatternLayout
    log4j.appender.A1.layout.ConversionPattern
    =%-4r [%t] %-5p %c %x - %m%n


    配套的log4j配置文件,使用下面命令啟動java org.jnp.server.Main,啟動之后,jndi客戶端需要jnp-client.jar文件來連接
    java.naming.provider.url=jnphost.mycompany.com:1099
    java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
    java.naming.factory.url.pkgs=org.jboss.naming
    連接參數如上



    posted @ 2011-06-20 11:23 在路上... 閱讀(384) | 評論 (0)編輯 收藏

         摘要: 通常,如果需要在應用中使用tomcat的jndi數據源,需要修改context配置,例如 <?xml version="1.0" encoding="UTF-8"?> <Context path="/app" docBase="E:\appweb">   <Resource name="jnd...  閱讀全文

    posted @ 2011-01-02 17:36 在路上... 閱讀(12339) | 評論 (0)編輯 收藏

    通過jconsole可以遠程監控web應用服務器,可以在啟動參數中加上

    -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=8888 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false

    posted @ 2011-01-02 17:14 在路上... 閱讀(868) | 評論 (0)編輯 收藏

    參考:http://blog.csdn.net/horsefaced/archive/2007/08/16/1746888.aspx

    這個異常源自于oracle驅動面對一個數值型的返回字段時,在得到指定的字段小數點右邊的數值數量時(Gets the designated column's number of digits to right of the decimal point.這個是原文),居然會返回-127,而oracle本身的cacheRowSet實現不允許這種情況出現,于是就會報標題所說的異常。

    對于一般的做法,需要修改很多地方,包括ResultSet的decorate類,還有Spring的SqlRowSetResultSetExtractor

    所謂頭痛醫頭,腳痛醫腳,這里提供一種方法直接從oracle jdbc驅動入手,徹底從源頭上修改掉該問題:
    反編譯ojdbc14.jar(Oracle 9i驅動為例)

    package oracle.jdbc.driver;

    public class OracleResultSetMetaData


    目標方法:
    public int getScale(int paramInt)
        throws SQLException
      {
        int i = getValidColumnIndex(paramInt);
        return this.statement.getDBDescription()[i].scale;
      }

    使用javassist編寫一段代碼:
     public  void crackOracleDriver() {
            ClassPool pool 
    = ClassPool.getDefault();
            
    try {
                pool.insertClassPath(
    "E:\\allproject\\bpmtrans\\lib\\ojdbc14.jar");
                CtClass cc 
    = pool.get("oracle.jdbc.driver.OracleResultSetMetaData");
                System.out.println(cc);
                CtClass[] param 
    = new CtClass[1] ;
                param[
    0]=pool.get("int");
                CtMethod a 
    = cc.getDeclaredMethod("getScale",param);
                System.out.println(a);
                a.setBody(
    "{int i = getValidColumnIndex($1);\n" +
                        
    "    int res=statement.getDBDescription()[i].scale;\n" +
                        
    "return res<0?0:res; }");
                cc.writeFile(
    "c:\\");

            }
     catch (Exception e) {
                e.printStackTrace();
            }

        }

    將生成的class置換原來的class,大功告成!

    這個所謂的精度,一般來說,修改了應該沒有多大問題的

    posted @ 2009-10-09 17:18 在路上... 閱讀(1883) | 評論 (1)編輯 收藏

    首先,下載openssl安裝,windows環境從http://www.openssl.org/related/binaries.html下載。
    我這里測試下載的版本是:http://www.slproweb.com/download/Win32OpenSSL-0_9_8h.exe
    安裝完成之后,修改bin目錄下面的openssl.cfg為openssl.cnf,在請求證書時需要用到這個配置文件,生成證書,為了方便,編寫了下面的批處理文件,供參考:


    @echo off
    echo 
    1.CA 創建一個 RSA 私用密鑰
    openssl genrsa 
    -out %1.key 1024 

    echo.
    echo 
    2.利用 CA 的 RSA 密鑰創建一個自簽署的 CA 證書(X.509結構)
    openssl req 
    -new -x509 -days 36500 -key %1.key -out %1.crt -subj /C=CN/ST=GuangDong/L=GuangZhou/O=SinoTech/OU=CA-SinoTech

    echo.
    echo 
    3.CA 創建一個 服務端 RSA 私用密鑰
    openssl genrsa 
    -out %2.key 1024 
    echo.

    echo 
    4.創建服務端簽署請求 CSR
    openssl req 
    -new -key %2.key -out %2.csr -subj "/C=CN/ST=GuangDong/L=GuangZhou/O=SinoTech/OU=Serv-SinoTech/CN=SinoTech Weblogic Server"

    echo.
    echo 
    5.簽署證書
    rem 準備一些默認文件、目錄,否則運行時會報錯
    if exist "%cd%\newcerts" goto got1
    md newcerts
    :got1

    if exist "%cd%\index.txt" goto got2
    echo tmp 
    >_tmp
    del _tmp 
    >index.txt
    :got2

    if exist "%cd%\serial" goto got3
    echo AD 
    >serial
    :got3

    openssl ca 
    -in %2.csr -out %2.crt -cert %1.crt -keyfile %1.key 
    echo.
    echo 處理完成
    pause

    運行批處理
    genca.cmd [CA證書名] [服務端證書名]
    例如genca.cmd ca server

    通過上面命令,會生成server.crt,server.key,然后將上面參數加到tomcat的配置中就可以使用SSL連接方式訪問網站應用了
    <Connector 
               
    port="8443" minSpareThreads="5" maxSpareThreads="75"
               enableLookups
    ="true" disableUploadTimeout="true" 
               acceptCount
    ="100"  maxThreads="200"
               scheme
    ="https" secure="true" SSLEnabled="true"
               SSLCertificateFile
    ="C:\apache-tomcat-6.0.16\conf\server.crt" 
               SSLCertificateKeyFile
    ="C:\apache-tomcat-6.0.16\conf\server.key"
               clientAuth
    ="false" sslProtocol="TLS"/>

    posted @ 2008-07-18 12:40 在路上... 閱讀(5849) | 評論 (3)編輯 收藏

      個人知識管理的29個原則

    1持續的學習成為個人生存和發展的基礎。持續學習不一定能帶來成功,但不學習一定失敗; 

    2信息和知識爆炸,在一段時間和時期內,學習的內容必須聚焦。起碼要在一個領域內成為專家。 

    3你應該學習的內容取決于你的價值觀、特長、個性和目標。

    4、你必須學會如何有效的評估信息和知識,所以你必須根據你的價值觀、特長、個性和目標確立自己對信息和知識的“過濾器”;

    5、人是知識獲取的重要渠道,所以你應該知道誰最擅長什么?遇到問題時知道可以向誰學習和請教;

    6、你牛了你的朋友也一定牛,建立人際資源的基礎是自己的知識基礎、個性和激情、自己優勢的合理展示和幫助別人的意愿;

    7、人際關系需要維護;捷徑是找到那些愿意共享自己朋友資源的人,你也應該做這樣的人;

    8、信息如果不經過處理,不能稱為知識。所以你存儲的知識起碼你應該簡單看過、知道是在講什么;

    9、信息和知識存儲前應該盡可能做規范化的工作,例如你做的摘要、感觸、覺得最有價值的部分、將來能做什么用等等;

    10、建立自己的分類字典,而不是每次想起什么就建立什么樣的文件夾或者標簽。分類字典,持之以恒堅持,適當調整;

    11、知識存儲中分類不宜過寬,過寬則等于沒有分類;分類不宜過深,過深后你就不會再去看;

    12、充分利用各種工具,尤其是web2.0工具做知識存儲和獲取工作;

    13知識存儲時適當共享,聽取和收集別人的意見和建議;

    14有意識的做知識顯性化的工作,既方便知識傳播也促進知識學習和建立人際網絡;

    15知識傳播中必須考慮傳播的方式和效率;

    16不能用簡單樸素的語言表述的知識證明你還沒有深入理解;

    17多用舉例子、講故事的方法傳播你的知識、見解。這個過程是你對知識的再深化過程;

    18你的知識傳播的越廣,你的影響力越大;

    19你的目的決定了你知識利用的方式。如果目的是要寫論文,則你的知識就是明確、簡潔的表達;如果是想要在市場上銷售,就必須產品化、規范化或者專利化;

    20知識本身沒有價值,只有被利用時才能展現其價值;

    21知識必須跟任務、項目結合起來才能發揮作用;

    22單獨的一個主題的知識很難被很好的利用,所以你必須將你的知識融入團隊中或者找到自己的合作伙伴;

    23知識創新最簡單的方法是總結和分析;

    24知識創新是一種習慣;

    25學習或者實踐---總結----將總結出來的內容投入實踐檢驗和請行家批評—繼續總結和實踐;

    26不能光做,還要思考;

    27個人競爭力的源泉不是你現在知道的或者掌握的,而是你選擇方向和快速學習的能力,是你能夠將知識用足用好的能力;

    28環境造就人,太安逸的環境對個人的發展弊大于利。如果不能找到好的環境,那就自己給自己壓力;

    29、既要會做,也要會展示自己做的,要有樹立個人品牌意識。

    posted @ 2008-06-21 16:07 在路上... 閱讀(348) | 評論 (0)編輯 收藏

    一般的數據庫中,DATE字段僅僅表示日期,不包括日期信息,而Oracle數據庫中的DATE數據類型是包括日期、時間的,對于不同的Oracle jdbc驅動版本,對于該問題的處理都有些區別,如果你使用9i或者11g
    的驅動程序,可能不會發現什么困惑,不幸的話,你使用Oracle10g的JDBC驅動,問題就來了,你會發現時間不見了
    看下面的程序
    • 表結構如下
    create table t_test(
    id int,
    date1 date,
    date2 timestamp,
    primary key(id)
    )

     1try {
     2            Class.forName("oracle.jdbc.OracleDriver");
     3            java.sql.Connection connection1 = DriverManager.getConnection("jdbc:oracle:thin:@192.168.8.200:1521:cdb""sysusr""sys");
     4            System.out.println(connection1);
     5            System.out.println(connection1.getMetaData().getDriverName()+" "+connection1.getMetaData().getDriverVersion());
     6            ResultSet rs = connection1.createStatement().executeQuery("select date1,date2 from t_test");
     7            rs.next();
     8             printInfo(rs,1);
     9            printInfo(rs,2);
    10        }

    11        catch (Exception exception1) {
    12            exception1.printStackTrace();
    13        }

    14
    15
    16public static void printInfo(ResultSet rs,int i) throws SQLException{
    17        ResultSetMetaData meta=rs.getMetaData();
    18        System.out.printf("Colname=%s,Type=%s,TypeName=%s,val=[%s];\n",meta.getColumnName(i),meta.getColumnType(i),meta.getColumnTypeName(i),rs.getObject(i).toString());
    19    }

    • 如果使用9i或者11g的驅動連接數據庫,返回結果如下:
    9i數據庫JDBC
    oracle.jdbc.driver.OracleConnection@16930e2
    Oracle JDBC driver 9.2.0.8.0
    Colname=DATE1,Type=91,TypeName=DATE,val=[2008-06-13 13:48:21.0];
    Colname=DATE2,Type=93,TypeName=TIMESTAMP,val=[oracle.sql.TIMESTAMP@18d107f];

    11g數據庫JDBC
    oracle.jdbc.driver.T4CConnection@a61164
    Oracle JDBC driver 11.1.0.6.0-Production+
    Colname=DATE1,Type=93,TypeName=DATE,val=[2008-06-13 13:48:21.0];
    Colname=DATE2,Type=93,TypeName=TIMESTAMP,val=[oracle.sql.TIMESTAMP@c4aad3];

    如果使用10g JDBC驅動,結果如下:
    oracle.jdbc.driver.T4CConnection@1bac748
    Oracle JDBC driver 10.2.0.2.0
    Colname=DATE1,Type=91,TypeName=DATE,val=[2008-06-13];
    Colname=DATE2,Type=93,TypeName=TIMESTAMP,val=[oracle.sql.TIMESTAMP@b8df17];

    結果是讓人困惑,時間怎么不見了?

    對于該問題,在Oracle的JDBC FAQ中有提到解決辦法:
    Prior to 9.2, the Oracle JDBC drivers mapped the DATE SQL type to java.sql.Timestamp. This made a certain amount of sense because the Oracle DATE SQL type contains both date and time information as does java.sql.Timestamp. The more obvious mapping to java.sql.Date was somewhat problematic as java.sql.Date does not include time information. It was also the case that the RDBMS did not support the TIMESTAMP SQL type, so there was no problem with mapping DATE to Timestamp. 

    In 9.2 TIMESTAMP support was added to the RDBMS. The difference between DATE and TIMESTAMP is that TIMESTAMP includes nanoseconds and DATE does not. So, beginning in 9.2, DATE is mapped to Date and TIMESTAMP is mapped to Timestamp. Unfortunately if you were relying on DATE values to contain time information, there is a problem. 

    There are several ways to address this problem: 

    Alter your tables to use TIMESTAMP instead of DATE. This is probably rarely possible, but it is the best solution when it is. 

    Alter your application to use defineColumnType to define the columns as TIMESTAMP rather than DATE. There are problems with this because you really don't want to use defineColumnType unless you have to (see What is defineColumnType and when should I use it?). 

    Alter you application to use getTimestamp rather than getObject. This is a good solution when possible, however many applications contain generic code that relies on getObject, so it isn't always possible. 

    Set the V8Compatible connection property. This tells the JDBC drivers to use the old mapping rather than the new one. You can set this flag either as a connection property or a system property. You set the connection property by adding it to the java.util.Properties object passed to DriverManager.getConnection or to OracleDataSource.setConnectionProperties. You set the system property by including a -D option in your java command line. 

      java -Doracle.jdbc.V8Compatible="true" MyApp


    參照上面的解釋,修改代碼如下可以解決10g JDBC驅動的問題:
    try {
                Class.forName(
    "oracle.jdbc.OracleDriver");
                Properties prop
    =new Properties();
                prop.setProperty(
    "user","sysuser");
                prop.setProperty(
    "password","sys");
                prop.setProperty(
    "oracle.jdbc.V8Compatible","true");
                java.sql.Connection connection1 
    = DriverManager.getConnection("jdbc:oracle:thin:@192.168.8.200:1521:cdb"
    , prop);
                System.out.println(connection1);
                System.out.println(connection1.getMetaData().getDriverName()
    +" "+connection1.getMetaData().getDriverVersion());
                ResultSet rs 
    = connection1.createStatement().executeQuery("select date1,date2 from t_test");
                rs.next();
                printInfo(rs,
    1);
                printInfo(rs,
    2);
            }

            
    catch (Exception exception1) {
                exception1.printStackTrace();
            }
    或者在系統變量中使用參數-Doracle.jdbc.V8Compatible="true",例如
    java -Doracle.jdbc.V8Compatible="true" MyApp

    結果如下:
    oracle.jdbc.driver.T4CConnection@9664a1
    Oracle JDBC driver 10.2.0.2.0
    Colname=DATE1,Type=93,TypeName=DATE,val=[2008-06-13 13:48:21.0];
    Colname=DATE2,Type=93,TypeName=DATE,val=[oracle.sql.TIMESTAMP@1172e08];

    posted @ 2008-06-13 14:19 在路上... 閱讀(7043) | 評論 (9)編輯 收藏

    僅列出標題
    共4頁: 上一頁 1 2 3 4 下一頁 
    主站蜘蛛池模板: 美女黄网站人色视频免费国产 | 精品亚洲成a人片在线观看| 久久成人免费大片| 亚洲人成网站在线观看播放动漫 | 一级毛片人与动免费观看| 香蕉视频在线观看亚洲| 99久久久国产精品免费无卡顿 | 中文字幕无码日韩专区免费| 亚洲欧洲中文日产| 亚洲?v女人的天堂在线观看| 无码日韩精品一区二区免费暖暖| 成人亚洲国产va天堂| 国产亚洲精午夜久久久久久| 很黄很色很刺激的视频免费| 好吊色永久免费视频大全| 亚洲另类精品xxxx人妖| 亚洲国产一区二区视频网站| 51精品视频免费国产专区| 猫咪免费人成在线网站| 亚洲狠狠ady亚洲精品大秀| 亚洲国产免费综合| 成人免费黄色网址| 国产一二三四区乱码免费| 亚洲精品无码av片| 亚洲免费视频在线观看| 亚洲AV蜜桃永久无码精品| 97在线观看永久免费视频| 亚洲国产免费综合| 亚洲男同gay片| 久久久亚洲欧洲日产国码二区| 免费A级毛片无码A∨男男| 国产男女爽爽爽爽爽免费视频| 一级a性色生活片久久无少妇一级婬片免费放 | 亚洲AV色无码乱码在线观看| 亚洲av无码潮喷在线观看| 国产在线观看免费视频播放器| free哆啪啪免费永久| 精品四虎免费观看国产高清午夜| 黄网站色视频免费看无下截 | 四虎在线成人免费网站| 最近国语视频在线观看免费播放|