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

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

          接下來再記錄一下相關(guān)的一些資料

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

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

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

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

          進(jìn)入yum repo目錄:/etc/yum.repos.d,編輯一個(gè)文件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可以加個(gè).bak擴(kuò)展名備份一下。
          或者可以使用參數(shù)
          yum --disablerepo=* --enablerepo=iso
          控制不同的repo使用

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

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

          2、配置yum代理

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

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

          或者可以通過環(huán)境變量加入當(dāng)前用戶的全局代理,可以修改.bash_profile文件:

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

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

          測(cè)試發(fā)帖,直接粘貼圖片看看效果如何!

          image

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

          通過下面方式可以發(fā)布jboss的naming服務(wù)
          <?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>


          同時(shí)也可以獨(dú)立使用,你需要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配置文件,使用下面命令啟動(dòng)java org.jnp.server.Main,啟動(dòng)之后,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
          連接參數(shù)如上



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

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

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

          通過jconsole可以遠(yuǎn)程監(jiān)控web應(yīng)用服務(wù)器,可以在啟動(dòng)參數(shù)中加上

          -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 在路上... 閱讀(878) | 評(píng)論 (0)編輯 收藏

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

          這個(gè)異常源自于oracle驅(qū)動(dòng)面對(duì)一個(gè)數(shù)值型的返回字段時(shí),在得到指定的字段小數(shù)點(diǎn)右邊的數(shù)值數(shù)量時(shí)(Gets the designated column's number of digits to right of the decimal point.這個(gè)是原文),居然會(huì)返回-127,而oracle本身的cacheRowSet實(shí)現(xiàn)不允許這種情況出現(xiàn),于是就會(huì)報(bào)標(biāo)題所說的異常。

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

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

          package oracle.jdbc.driver;

          public class OracleResultSetMetaData


          目標(biāo)方法:
          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,大功告成!

          這個(gè)所謂的精度,一般來說,修改了應(yīng)該沒有多大問題的

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

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


          @echo off
          echo 
          1.CA 創(chuàng)建一個(gè) RSA 私用密鑰
          openssl genrsa 
          -out %1.key 1024 

          echo.
          echo 
          2.利用 CA 的 RSA 密鑰創(chuàng)建一個(gè)自簽署的 CA 證書(X.509結(jié)構(gòu))
          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 創(chuàng)建一個(gè) 服務(wù)端 RSA 私用密鑰
          openssl genrsa 
          -out %2.key 1024 
          echo.

          echo 
          4.創(chuàng)建服務(wù)端簽署請(qǐng)求 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 準(zhǔn)備一些默認(rèn)文件、目錄,否則運(yùn)行時(shí)會(huì)報(bào)錯(cuò)
          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

          運(yùn)行批處理
          genca.cmd [CA證書名] [服務(wù)端證書名]
          例如genca.cmd ca server

          通過上面命令,會(huì)生成server.crt,server.key,然后將上面參數(shù)加到tomcat的配置中就可以使用SSL連接方式訪問網(wǎng)站應(yīng)用了
          <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 在路上... 閱讀(5862) | 評(píng)論 (3)編輯 收藏

            個(gè)人知識(shí)管理的29個(gè)原則

          1持續(xù)的學(xué)習(xí)成為個(gè)人生存和發(fā)展的基礎(chǔ)。持續(xù)學(xué)習(xí)不一定能帶來成功,但不學(xué)習(xí)一定失敗; 

          2信息和知識(shí)爆炸,在一段時(shí)間和時(shí)期內(nèi),學(xué)習(xí)的內(nèi)容必須聚焦。起碼要在一個(gè)領(lǐng)域內(nèi)成為專家。 

          3你應(yīng)該學(xué)習(xí)的內(nèi)容取決于你的價(jià)值觀、特長(zhǎng)、個(gè)性和目標(biāo)。

          4、你必須學(xué)會(huì)如何有效的評(píng)估信息和知識(shí),所以你必須根據(jù)你的價(jià)值觀、特長(zhǎng)、個(gè)性和目標(biāo)確立自己對(duì)信息和知識(shí)的“過濾器”;

          5、人是知識(shí)獲取的重要渠道,所以你應(yīng)該知道誰(shuí)最擅長(zhǎng)什么?遇到問題時(shí)知道可以向誰(shuí)學(xué)習(xí)和請(qǐng)教;

          6、你牛了你的朋友也一定牛,建立人際資源的基礎(chǔ)是自己的知識(shí)基礎(chǔ)、個(gè)性和激情、自己優(yōu)勢(shì)的合理展示和幫助別人的意愿;

          7、人際關(guān)系需要維護(hù);捷徑是找到那些愿意共享自己朋友資源的人,你也應(yīng)該做這樣的人;

          8、信息如果不經(jīng)過處理,不能稱為知識(shí)。所以你存儲(chǔ)的知識(shí)起碼你應(yīng)該簡(jiǎn)單看過、知道是在講什么;

          9、信息和知識(shí)存儲(chǔ)前應(yīng)該盡可能做規(guī)范化的工作,例如你做的摘要、感觸、覺得最有價(jià)值的部分、將來能做什么用等等;

          10、建立自己的分類字典,而不是每次想起什么就建立什么樣的文件夾或者標(biāo)簽。分類字典,持之以恒堅(jiān)持,適當(dāng)調(diào)整;

          11、知識(shí)存儲(chǔ)中分類不宜過寬,過寬則等于沒有分類;分類不宜過深,過深后你就不會(huì)再去看;

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

          13知識(shí)存儲(chǔ)時(shí)適當(dāng)共享,聽取和收集別人的意見和建議;

          14有意識(shí)的做知識(shí)顯性化的工作,既方便知識(shí)傳播也促進(jìn)知識(shí)學(xué)習(xí)和建立人際網(wǎng)絡(luò);

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

          16不能用簡(jiǎn)單樸素的語(yǔ)言表述的知識(shí)證明你還沒有深入理解;

          17多用舉例子、講故事的方法傳播你的知識(shí)、見解。這個(gè)過程是你對(duì)知識(shí)的再深化過程;

          18你的知識(shí)傳播的越廣,你的影響力越大;

          19你的目的決定了你知識(shí)利用的方式。如果目的是要寫論文,則你的知識(shí)就是明確、簡(jiǎn)潔的表達(dá);如果是想要在市場(chǎng)上銷售,就必須產(chǎn)品化、規(guī)范化或者專利化;

          20知識(shí)本身沒有價(jià)值,只有被利用時(shí)才能展現(xiàn)其價(jià)值;

          21知識(shí)必須跟任務(wù)、項(xiàng)目結(jié)合起來才能發(fā)揮作用;

          22單獨(dú)的一個(gè)主題的知識(shí)很難被很好的利用,所以你必須將你的知識(shí)融入團(tuán)隊(duì)中或者找到自己的合作伙伴;

          23知識(shí)創(chuàng)新最簡(jiǎn)單的方法是總結(jié)和分析;

          24知識(shí)創(chuàng)新是一種習(xí)慣;

          25學(xué)習(xí)或者實(shí)踐---總結(jié)----將總結(jié)出來的內(nèi)容投入實(shí)踐檢驗(yàn)和請(qǐng)行家批評(píng)—繼續(xù)總結(jié)和實(shí)踐;

          26不能光做,還要思考;

          27個(gè)人競(jìng)爭(zhēng)力的源泉不是你現(xiàn)在知道的或者掌握的,而是你選擇方向和快速學(xué)習(xí)的能力,是你能夠?qū)⒅R(shí)用足用好的能力;

          28環(huán)境造就人,太安逸的環(huán)境對(duì)個(gè)人的發(fā)展弊大于利。如果不能找到好的環(huán)境,那就自己給自己壓力;

          29、既要會(huì)做,也要會(huì)展示自己做的,要有樹立個(gè)人品牌意識(shí)。

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

          一般的數(shù)據(jù)庫(kù)中,DATE字段僅僅表示日期,不包括日期信息,而Oracle數(shù)據(jù)庫(kù)中的DATE數(shù)據(jù)類型是包括日期、時(shí)間的,對(duì)于不同的Oracle jdbc驅(qū)動(dòng)版本,對(duì)于該問題的處理都有些區(qū)別,如果你使用9i或者11g
          的驅(qū)動(dòng)程序,可能不會(huì)發(fā)現(xiàn)什么困惑,不幸的話,你使用Oracle10g的JDBC驅(qū)動(dòng),問題就來了,你會(huì)發(fā)現(xiàn)時(shí)間不見了
          看下面的程序
          • 表結(jié)構(gòu)如下
          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的驅(qū)動(dòng)連接數(shù)據(jù)庫(kù),返回結(jié)果如下:
          9i數(shù)據(jù)庫(kù)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數(shù)據(jù)庫(kù)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驅(qū)動(dòng),結(jié)果如下:
          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];

          結(jié)果是讓人困惑,時(shí)間怎么不見了?

          對(duì)于該問題,在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驅(qū)動(dòng)的問題:
          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();
                  }
          或者在系統(tǒng)變量中使用參數(shù)-Doracle.jdbc.V8Compatible="true",例如
          java -Doracle.jdbc.V8Compatible="true" MyApp

          結(jié)果如下:
          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 在路上... 閱讀(7056) | 評(píng)論 (9)編輯 收藏

          僅列出標(biāo)題
          共4頁(yè): 上一頁(yè) 1 2 3 4 下一頁(yè) 
          主站蜘蛛池模板: 儋州市| 江阴市| 郁南县| 潜山县| 汶上县| 伊春市| 慈溪市| 论坛| 田林县| 鄄城县| 宕昌县| 伊金霍洛旗| 繁峙县| 辽中县| 惠安县| 当阳市| 团风县| 会理县| 清水河县| 东台市| 芜湖县| 辽宁省| 兴海县| 永德县| 蓝山县| 云霄县| 调兵山市| 安平县| 洛隆县| 安丘市| 静海县| 荥经县| 宁武县| 云安县| 多伦县| 高密市| 丰都县| 绥化市| 九龙县| 中西区| 五寨县|