您的位置:首页 > Web前端

To estimate the database's effective!

2006-12-16 10:35 211 查看
 Use the System.currentTimeMillis() to estimate the database's effetive!

Code:

        Timestamp st=new Timestamp(System.currentTimeMillis());
        customer = (CustomerInfo) sqlMapSE.queryForObject("queryCustomerByname", userName);
        Timestamp et=new Timestamp(System.currentTimeMillis());
        try
        {
            out.write("1: queryCustomerByname            "+(et.getTime()-st.getTime())+" ");
            out.write("/r/n");
            out.flush();
        }
        catch(Exception e)
        {
            e.printStackTrace();
        }

or more simple:

        long st=System.currentTimeMillis();
        List list = sqlMapSE.queryForList("queryMarketBySector", hm);
        long et=System.currentTimeMillis();
        try
        {
           out.write("3: queryMarketBySector    "+(et-st));
           out.write("/r/n");
           out.flush();
        }
        catch(Exception e)
        {
           e.printStackTrace();
        }

 
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  database exception list
相关文章推荐