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

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

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

    KK

    Kim-'s-Blog.Object-Everything.I'm POJO.

    .紀-錄.爲了忘卻的記憶..真的勇士,要敢于直面遇到的問題,敢于正視繁雜的原碼......在實踐中積累!

      BlogJava :: 首頁 :: 聯系 :: 聚合  :: 管理
      74 Posts :: 1 Stories :: 70 Comments :: 0 Trackbacks

    #

    Spring JDBC 很好用。
    -------------------------------
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "

    <beans>
    ?<bean id="dataSource"
    ??class="org.springframework.jdbc.datasource.DriverManagerDataSource"
    ??abstract="false" singleton="true" lazy-init="default"
    ??autowire="default" dependency-check="default">
    ?<property name="driverClassName"><value>oracle.jdbc.OracleDriver</value></property>
    ?<property name="url"><value>jdbc:oracle:thin:@10.240.144.11:1521:XYMES</value></property>
    ?<property name="username"><value>reel</value></property>
    ?<property name="password"><value>reel</value></property>
    ?</bean>
    </beans>
    ------------------------------------
    package com.kim.spring;
    import java.util.List;

    import javax.sql.DataSource;
    import org.springframework.context.ApplicationContext;
    import org.springframework.context.support.FileSystemXmlApplicationContext;
    import org.springframework.jdbc.core.JdbcTemplate;

    public class Test
    {

    ?/**
    ? * @param args
    ? */
    ?public void aMethod()throws Exception
    ?{?
    ??ApplicationContext ac=new FileSystemXmlApplicationContext("F:\\kim\\kimjob\\springkim\\src\\applicationContext.xml");
    ??DataSource dataSource=(DataSource)ac.getBean("dataSource");
    ??JdbcTemplate jt=new JdbcTemplate(dataSource);
    ??List l= jt.queryForList("select * from abc");
    ??System.out.println(l.get(0).toString());
    ??System.out.println(l.get(0));
    ??int i= jt.update("update abc set bb='8'");
    ??System.out.println(i);
    ??
    ?}
    ?public static void main(String[] args)
    ?{
    ??// TODO Auto-generated method stub
    ??Test t=new Test();
    ??try
    ??{
    ???t.aMethod();
    ??} catch (Exception e)
    ??{
    ???// TODO: handle exception
    ???e.printStackTrace();
    ??}
    ?}
    }
    ---------------------------------
    結果:
    log4j:WARN No appenders could be found for logger (org.springframework.core.CollectionFactory).
    log4j:WARN Please initialize the log4j system properly.
    {AA=2, BB=8, CC=2}
    1


    ?Exp時遭遇?EXP-00008 ORA-00942 EXP-00024 EXP-00000

    About to export specified users ...
    . exporting pre-schema procedural objects and actions
    . exporting foreign function library names for user QCSYSTEM
    . exporting PUBLIC type synonyms
    . exporting private type synonyms
    . exporting object type definitions for user QCSYSTEM
    EXP-00008: ORACLE error 942 encountered
    ORA-00942: table or view does not exist
    EXP-00024: Export views not installed, please notify your DBA
    EXP-00000: Export terminated unsuccessfully

    是沒有乾淨升級至9204所至!
    重新運行catexp.sql 解決。

    The export views are not correctly installed. Try doing this:
    run following script:
    1).Login in as sys user.

    2).run the $ORACLE_HOME/rdbms/admin/catexp.sql file. This will recreate all your exp related views.

    3).run the exp again.

    This will resolve issue.

    posted @ 2007-01-10 09:36 Kim' 閱讀(2472) | 評論 (0)編輯 收藏

    .$ORACLE_HOME//network/log/下的listener.log寫爆了你的listener就用不了
    出錯
    'ORA-12516: TNS: 監聽程序無法找到匹配協議棧的可用句柄'
    解決:清理該文件。
    posted @ 2007-01-05 16:46 Kim' 閱讀(790) | 評論 (0)編輯 收藏

    解決辦法:
    1.確認正確設置了tomcat_home 和ant_home環境變量
    2.copy $tomcat_home\server\lib\catalina-ant.jar 到 $ant_home\lib目錄下即可。
    posted @ 2007-01-05 13:52 Kim' 閱讀(4342) | 評論 (2)編輯 收藏

    CJQ0進程失效,首先設置JOB_QUEUE_PROCESSES為0,Oracle會殺掉CJQ0及相應job進程
    SQL> ALTER SYSTEM SET JOB_QUEUE_PROCESSES = 0;

    等2~3分鐘,重新設置

    SQL> ALTER SYSTEM SET JOB_QUEUE_PROCESSES = 5;

    此時PMON會重起CJQ0進程
    -----------------------------------
    若為Oracle 9.2.0.3可能有Bug ,升到9.2.0.4,9.2.0.6就OK了。

    posted @ 2007-01-03 10:28 Kim' 閱讀(2904) | 評論 (0)編輯 收藏

    當用startup?mount啟動數據庫,報ORA-01991,密碼文件錯時,可用以下方法之一解決:
    1、重新生成新的密碼配置文件(推薦)
    orapwd?file=/oracle/app/product/9.2.0/dbs/orapwYOUSID?password=YOUR_SYS_PASSWORD?entries=YOUR_MAX_DBAS
    2、用initYOUSID方式啟動數據庫
    修改以下參數后,重啟數據庫
    remote_login_passwordfile=noe
    posted @ 2007-01-02 17:03 Kim' 閱讀(387) | 評論 (0)編輯 收藏

         摘要: ※※※※Mysql 初級解讀(所用版本: 4.1.10 ) ※※※※※※※ 安裝注意事項 ...  閱讀全文
    posted @ 2007-01-02 16:51 Kim' 閱讀(272) | 評論 (0)編輯 收藏

    Hibernate 配置
    <hibernate-configuration>

    ??? <session-factory>
    ??????? <!-- properties -->
    ??????? <property name="connection.datasource">java:comp/env/jdbc/REEL1</property>
    ??????? <property name="show_sql">true</property>

    ??????? <property name="dialect"></property>


    ??????? <!-- mapping files -->
    ??????? <mapping resource="com/gecs/steel/SIntro.hbm.xml"/>
    ??????? <mapping resource="com/gecs/steel/SStore.hbm.xml"/>

    ??? </session-factory>

    </hibernate-configuration>

    -------------------------------------------------------
    Tomcat 的Server.xml
    <Resource name="jdbc/REEL1" auth="Container" type="javax.sql.DataSource"/>
    ?<ResourceParams name="jdbc/REEL1">
    ?? <parameter>
    ???? <name>factory</name>
    ???? <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
    ?? </parameter>
    ?? <parameter>
    ???? <name>driverClassName</name>
    ???? <value>oracle.jdbc.driver.OracleDriver</value>
    ?? </parameter>
    ?? <parameter>
    ???? <name>url</name>
    ???? <value>jdbc:oracle:thin:@10.240.144.16:1521:SMT</value>
    ?? </parameter>
    ?? <parameter>
    ???? <name>username</name>
    ???? <value>smtuser</value>
    ?? </parameter>
    ?? <parameter>
    ???? <name>password</name>
    ???? <value>smtmanager</value>
    ?? </parameter>
    ?? <parameter>
    ???? <name>maxActive</name>
    ???? <value>100</value>
    ?? </parameter>
    ?? <parameter>
    ???? <name>maxIdle</name>
    ???? <value>60</value>
    ?? </parameter>
    ?? <parameter>
    ???? <name>maxWait</name>
    ???? <value>10000</value>
    ???? </parameter>
    ?? <parameter>
    ???? <name>removeAbandoned</name>
    ???? <value>true</value>
    ?? </parameter>
    ???? <parameter>
    ?????? <name>logAbandoned</name>
    ?????? <value>false</value>
    ???? </parameter>
    ??????????? <parameter>
    ?????? <name>removeAbandonedTimeout</name>
    ?????? <value>1</value>
    ???? </parameter>
    ?? </ResourceParams>

    posted @ 2006-12-22 09:57 Kim' 閱讀(324) | 評論 (0)編輯 收藏

    一、Axis安裝

        1、環境 J2SE SDK 1.3 or 1.4:我使用 1.4.2
        Servlet Container:我使用的Tomcat 5.0

      2、到 http://ws.Apache.org/axis/ 網站下載Axis安裝包

      3、解壓縮安裝包,
    ????????????? 將Axis UNZIP_PATH\Axis-version\webapps下的Axis包拷貝到?
    ????????????? TOMCAT_HOME\webapps\下,以下約定Axis_HOME為該TOMCAT_HOME\webapps\axis目錄

      4、啟動tomcat, 訪問http://localhost:8080/axis 檢查安裝是否成功,本機為http://localhost:7777/axis

      5、以上步驟執行成功,可以開發webservice例子了

    二、編寫DII(Dynamic Invocation Interface )方式web服務

      1.編寫服務端程序SayHello.java

    ??????? public class SayHello {
    ??????????? public String getName(String name) {
    ??????????????? return "hello "+name;
    ??????????? }
    ??????? }
    ??????? 2、將源碼拷貝到Axis_HOME下,重命名為SayHello.jws

      3、訪問連接http://localhost:7777/axis/SayHello.jws?wsdl,頁面顯示Axis自動生成的wsdl

      4、編寫訪問服務的客戶端 SayHelloClient.java
    ??????? import org.apache.axis.client.Call;
    ??????? import org.apache.axis.client.Service;
    ??????? import javax.xml.namespace.QName;
    ??????? import javax.xml.rpc.ServiceException;
    ??????? import java.net.MalformedURLException;
    ??????? import java.rmi.RemoteException;

    ??????? public class SayHelloClient {
    ??????????? public static void main(String[] args) {
    ??????????????? try {
    ??????????????????? String endpoint = "http://localhost:7777/axis/SayHello.jws";
    ??????????????????? Service service = new Service();
    ??????????????????? Call call = null;
    ??????????????????? call = (Call) service.createCall();
    ??????????????????? call.setOperationName(new QName("http://localhost:7777/axis/SayHello.jws",
    ??????????????????? "getName"));
    ??????????????????? call.setTargetEndpointAddress(new java.net.URL(endpoint));
    ??????????????????? String ret = (String) call.invoke(new Object[] {"Kim"});
    ??????????????????? System.out.println("return value is " + ret);
    ??????????????? }
    ??????????????? catch (Exception ex) {
    ??????????????????? ex.printStackTrace();
    ??????????????? }
    ??????????? }
    ??????? }
    5.運行該Java文件
    顯示return value is hello Kim
    OK!

    另:
    Axis支持三種web service的部署和開發,分別為:

      1、Dynamic Invocation Interface ( DII)

      2、Stubs方式

      3、Dynamic Proxy方式

    posted @ 2006-12-18 14:52 Kim' 閱讀(738) | 評論 (2)編輯 收藏

    添加
    F:\kim\kimjob\RMI>java -Djava.security.policy=policy.txt? -Djava.rmi.server.codebase=file:/f:\kim\kimjob\RMI/? XXXX
    posted @ 2006-12-15 17:44 Kim' 閱讀(323) | 評論 (0)編輯 收藏

    僅列出標題
    共8頁: 上一頁 1 2 3 4 5 6 7 8 下一頁 
    jj
    主站蜘蛛池模板: 久久精品国产亚洲AV麻豆网站| 亚洲成av人片不卡无码久久| 日木av无码专区亚洲av毛片| 女人体1963午夜免费视频| 久久国产亚洲精品麻豆| a国产成人免费视频| 亚洲VA中文字幕不卡无码| 久久久久久AV无码免费网站下载 | 久久久精品免费国产四虎| 亚洲综合av永久无码精品一区二区| 乱人伦中文视频在线观看免费| yy6080亚洲一级理论| 国产一级高青免费| 亚洲福利视频一区| 国产日本一线在线观看免费| 中国china体内裑精亚洲日本| 美女被免费视频网站a国产| 香蕉视频免费在线| 亚洲热妇无码AV在线播放| 香蕉免费一区二区三区| 亚洲av乱码一区二区三区| 国产成人免费片在线视频观看| a毛片视频免费观看影院| 亚洲AV无码久久精品色欲| 久久成人国产精品免费软件| 亚洲AV无码一区二区三区人| 日本久久久免费高清| 香蕉免费看一区二区三区| 亚洲成AV人综合在线观看| 暖暖日本免费在线视频| eeuss影院免费92242部| 亚洲综合一区二区精品导航| 在线观看人成网站深夜免费| 久久精品无码专区免费| 亚洲伊人色一综合网| 亚洲综合久久夜AV | 可以免费看黄的网站| j8又粗又长又硬又爽免费视频| 老汉色老汉首页a亚洲| 波多野结衣中文一区二区免费| 免费观看91视频|