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

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

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

    waterye

    #

    鎖管理

    查看鎖
    select t2.username,t2.sid,t2.serial#,t2.logon_time 
      
    from v$locked_object t1,v$session t2 
     
    where t1.session_id=t2.sid order by t2.logon_time;

    kill 鎖
    alter system kill session 'sid,serail#';
    也可以用oem來殺掉

    posted @ 2005-09-07 00:55 waterye 閱讀(301) | 評論 (0)編輯 收藏

    升級播放程序

    為了播放不同編碼的視頻文件, 真的好煩, 裝了一堆播放器, 有的還不兼容, 千萬不要用不負責任ffdshow。

    RealPlayer+K-Lite Code Pack(2.5.3)+WinDvd(7.0 Platinum),KMplayer當備用


    現(xiàn)在順心多了, 但還有點小問題, WinDvd(占用cpu很少)播放小部分vob還是會出錯, 用realplayer代勞算了。

    posted @ 2005-09-07 00:51 waterye 閱讀(586) | 評論 (2)編輯 收藏

    GvTags

    GvTags makes it easy to write web applications in the new dynamic programming language Groovy. GvTags is a Groovy Tag library for Java ServerPages (JSP). GvTags might be for the Groovy programming language what the combination of JSTL and Struts is for Java, or Smarty is for PHP.

    官方站點: http://gvtags.berlios.de/cgi-bin/gvtagswiki.pl

    最新版本是0.1.1

    下載了源碼包看了一下, 還是挺有意思的.

    <gv:import class='org.gvtags.examples.counter.Counter' />
    <gv:bean var='c' class='Counter' scope='session' />
    <gv:formbean var='formBean' />
    <gv:code>
        if (formBean.submit != null) {
            // handle input
            switch(formBean.submit.trim()) {
                case "+":
                    c.increment()
                    break
                case "-":
                    c.decrement()
                    break
                case "Reset":
                    c.reset()
                    break
            }
        }
    </gv:code>

    大部分源碼是groovy寫的

    posted @ 2005-09-05 18:45 waterye 閱讀(614) | 評論 (1)編輯 收藏

    pl/sql script

    將select出來的數(shù)據(jù)update到其他table, 使用JDBC的話幾行代碼就搞定, 但要經(jīng)過不算煩人的compile, 為了在沒有Java的環(huán)境使用(安裝新版本的Oracle要JVM)

    用pl/sql script是更簡單方法,從在線文檔copy個sample過來, 改一改就能用

    DECLARE
        
    CURSOR c1 IS SELECT order_item_no, unit_price FROM sale_order_item;
        TYPE ResultSet 
    IS TABLE OF c1%ROWTYPE;
        rs ResultSet; 
    BEGIN
        
        
    select i.order_item_no, goods.unit_price BULK COLLECT into rs
      
    from sale_order o, sale_order_item i, goods
     
    where o.order_no = i.order_no
       
    and i.goods_no = goods.goods_no
       
    and trunc(o.order_time, 'month'>= to_date('2005-6''yyyy-mm');

        
    IF rs.count > 0 THEN 
            
    FOR i IN rs.FIRST .. rs.LAST LOOP
                
    update sale_order_item set unit_price = rs(i).unit_price where order_item_no = rs(i).order_item_no;
            
    END LOOP; 
        
    END IF;
        
        
    commit;
            
    END;

    再在sqlplus運行
    sqlplus /nolog
    conn 
    user/passoword@sid
    @update.sql

    posted @ 2005-09-03 16:26 waterye 閱讀(402) | 評論 (0)編輯 收藏

    Groovy String

    1. 單行String
    單引號是普通字符串, 雙引號是GString
    def hw = 'hello, world'
    println 
    'hello, world'
    println 
    'groovy say "Hello, world!"'
    println 
    "groovy say ${hw}"

    2. 多行String
    def blogAddr = 'http://m.tkk7.com/waterye'
    println 
    """\
    Water Ye's blog:
    ${blogAddr}
    """

    3. 使用range獲取substring
    println hw[hw.length()-1..0]
    不用羨慕python,ruby了

    4. 增加的api, 參考gdk
    http://groovy.codehaus.org/groovy-jdk.html

    posted @ 2005-09-03 15:55 waterye 閱讀(3193) | 評論 (0)編輯 收藏

    Hibernate的視圖功能

    Hibernate3增加了視圖功能

    1. 定義hbm
        <class name="Customer" table="customer">        
            
    <id name="id" unsaved-value="0" column="id">
                
    <generator class="hilo"/>
            
    </id>        
            
    <property name="name"  not-null="true"/>        
        
    </class>
        
        
    <class name="Supplier" table="supplier">        
            
    <id name="id" unsaved-value="0" column="id">
                
    <generator class="hilo"/>
            
    </id>
            
    <property name="name" not-null="true"/>            
        
    </class>
        
        
    <class name="All" mutable="false">    
            
    <subselect>
                select id, name from customer
                union 
                select id, name from supplier
            
    </subselect>
            
            
    <synchronize table="customer"/>
            
    <synchronize table="supplier"/>
            
            
    <id name="id" unsaved-value="0" column="id">
                
    <generator class="hilo"/>
            
    </id>        
            
    <property name="name"/>        
        
    </class>

    2. 定義POJO
    pulic class Customer {
        
    public Integer id;
        
    public String name;
    }


    pulic 
    class Supplier {
        
    public Integer id;
        
    public String name;
    }


    pulic 
    class All {
        
    public Integer id;
        
    public String name;
    }

    3. 查詢
    List all = session.createQuery("from All").list();

    posted @ 2005-09-02 22:39 waterye 閱讀(5869) | 評論 (2)編輯 收藏

    復(fù)制表

    復(fù)制表結(jié)構(gòu)和數(shù)據(jù)
    create table new_table as select * from old_table;

    復(fù)制表結(jié)構(gòu)
    create table new_table as select * from old_table where 1=0;

    posted @ 2005-09-02 21:58 waterye 閱讀(362) | 評論 (0)編輯 收藏

    通過RowId刪除重復(fù)記錄

    通過RowId刪除重復(fù)記錄

    DELETE FROM test t1
     
    WHERE t1.ROWID <
           (
    SELECT max(t2.ROWID) FROM test t2 WHERE t2.name = t1.name);

    posted @ 2005-09-01 20:54 waterye 閱讀(381) | 評論 (0)編輯 收藏

    Spring book

    隨著Spring的流行, 書還真出了不少

    本人收集的有:
    1. <<Spring Live>>
    2. <<Spring In Action>>
    3. <<Pro Spring>>
    4. <<Spring A Developers Notebook>>
    5. <<Professional Java Development with the Spring Framework>>

    看了第5本(Core Developer寫的)的話, 就不用看其他的了, 有的簡直是騙錢,還不如看petclinic

    posted @ 2005-08-31 21:20 waterye 閱讀(2755) | 評論 (12)編輯 收藏

    Hibernate的查詢方式

    小結(jié)Hibernate的查詢方式

    1. get() and load()
    session.get(Clazz, id);
    session.load(Clazz, id);

    說明: load()與get()的區(qū)別
    請注意如果沒有匹配的數(shù)據(jù)庫記錄,load()方法可能拋出無法恢復(fù)的異常(unrecoverable exception)。 如果類的映射使用了代理(proxy),load()方法會返回一個未初始化的代理,直到你調(diào)用該代理的某方法時才會去訪問數(shù)據(jù)庫。 若你希望在某對象中創(chuàng)建一個指向另一個對象的關(guān)聯(lián),又不想在從數(shù)據(jù)庫中裝載該對象時同時裝載相關(guān)聯(lián)的那個對象,那么這種操作方式就用得上的了。 如果為相應(yīng)類映射關(guān)系設(shè)置了batch-size, 那么使用這種操作方式允許多個對象被一批裝載(因為返回的是代理,無需從數(shù)據(jù)庫中抓取所有對象的數(shù)據(jù))。

    如果你不確定是否有匹配的行存在,應(yīng)該使用get()方法,它會立刻訪問數(shù)據(jù)庫,如果沒有對應(yīng)的行,會返回null

    2. HQL

    // 返回一行記錄
    String hql = "from TOrder o where o.id = ?";
    TOrder o 
    = (TOrder) s.createQuery(hql)
            .setParameter(
    0, orderId)
            .uniqueResult();

    // 命名參數(shù)
    Query q = sess.createQuery("from DomesticCat cat where cat.name = :name");
    q.setString(
    "name""Fritz");

    // 位置參數(shù)
    Query q = sess.createQuery("from DomesticCat cat where cat.name = ?");
    q.setString(
    0"Izi");

    // 命名參數(shù)列表
    Query q = sess.createQuery("from DomesticCat cat where cat.name in (:namesList)");
    q.setParameterList(
    "namesList", names);

    // 分頁查詢 
    Query q = sess.createQuery("from DomesticCat cat");
    q.setFirstResult(
    20);
    q.setMaxResults(
    10);
    List cats 
    = q.list();


    3. Criteria

    List list = s.createCriteria(Enrolment.class)
                .createAlias(
    "student""s")
                .createAlias(
    "course""c")
                .add( Restrictions.isNotEmpty(
    "s.enrolments") )
                .setProjection( Projections.projectionList()
                        .add( Projections.property(
    "s.name") )
                        .add( Projections.property(
    "c.description") )
                )
                .setCacheable(
    true)
                .list();


    4. Native SQL

    String treeSql = "" +
                    
    "select {t.*}, level from tree t " +
                    
    " start with t.parent_id = 0 " +
                    
    " connect by prior t.id = t.parent_id";

    List result 
    = session.createSQLQuery(treeSql)
        .addEntity(
    "t", Tree.class)
        .addScalar(
    "level", Hibernate.INTEGER)
        .list();

    5. Named SQL queries(不推薦)

    6. filter(不推薦)

    7. Detached queries(還沒測試)
    The DetachedCriteria class lets you create a query outside the scope of a session, and then later execute it using some arbitrary Session

    參考
    1. Hibernate Reference Documentation
    2. Hibernate test case

    posted @ 2005-08-29 16:34 waterye 閱讀(4125) | 評論 (3)編輯 收藏

    僅列出標題
    共18頁: First 上一頁 10 11 12 13 14 15 16 17 18 下一頁 
    主站蜘蛛池模板: 97人妻无码一区二区精品免费| 亚洲国产精品无码专区影院| 免费在线观看中文字幕| 久久精品国产精品亚洲色婷婷| 老司机午夜性生免费福利 | 大地资源中文在线观看免费版| 免费观看的a级毛片的网站| 亚洲老妈激情一区二区三区| 羞羞视频在线免费观看| 亚洲AV无码国产在丝袜线观看| 成人毛片手机版免费看| 亚洲天堂2016| 一个人免费高清在线观看| 亚洲av片不卡无码久久| 1000部禁片黄的免费看| 亚洲人成电影青青在线播放| 可以免费看黄视频的网站| 亚洲中文字幕无码中文字| 成年免费大片黄在线观看岛国| 人与动性xxxxx免费| 亚洲精品国产品国语在线| 91嫩草国产在线观看免费| 国产真人无码作爱免费视频| 青青草原亚洲视频| 国产黄色免费观看| 亚洲线精品一区二区三区| 91av视频免费在线观看| 亚洲免费人成视频观看| 国产亚洲av人片在线观看| 韩国日本好看电影免费看| 4444www免费看| 香蕉免费看一区二区三区| 久久青青草原亚洲av无码app | 久久夜色精品国产嚕嚕亚洲av| 国产精品视频白浆免费视频| 亚洲欧洲日产韩国在线| 日韩高清免费在线观看| 成在线人直播免费视频| 亚洲精品中文字幕| 伊人久久亚洲综合| 亚洲精品97久久中文字幕无码|