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();
}
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();
}
相关文章推荐
- How to Add the JVM Component to an Existing Oracle Database (Doc ID 1461562.1)
- 34.A user, who is authenticated externally, logs in to a remote machine and connects to the database
- 35.You executed the command to create a password file in the database server:
- How To List All The Named Events Set For A Database
- 37.You execute the following command to audit database activities:
- master password is required to unlock the password database.the password database will be unlocked d
- 68.You are managing an Oracle Database 11g database. You want to ensure the recovery of the database
- 183 Examine the following command that is used to duplicate a database on the same host: RMAN> RUN {
- connect to remote mysql database by the java
- Test the connection to Portal Server Database wpsdb
- Enterprise Manager is not able to connect to the database instance.(ORA-28001)错误的解决方法[转载]
- Error while preforming database login with the "sqlserver" driver Unable to create...
- How to create svn database on the ubuntu
- How to change the vCenter Database (vSphere 5.1)
- there are still active users connected to the database
- Physical Database Design: the database professional's guide to exploiting indexes, views, storage, a
- How to Backup Different Release Databases with the Same Catalog Database
- 在PowerDesigner12 逆向工程DataBase SQl时出现:unable to list the tables 信息
- Issue: Server principal is not able to access the database under the current security context
- sql中:The database could not be exclusively locked to perform the operation. 错误处理