Capturing cfml execution time

Hi, good day to all! Is there any way on how to capture an
execution time of a cfm instruction? I have two situations, but I
think they're similar as shown below:
1st situation:
<!--- start query --->
<cfquery name = "q1" datasource="#db#">
SQL statement
</cfquery>
<cfquery name = "q2" datasource="#db#">
SQL statement
</cfquery>
<cfquery name = "q3" datasource="#db#">
SQL statement
</cfquery>
<cfquery name = "q4" datasource="#db#">
SQL statement
</cfquery>
<!--- end query --->
For the 1st situation above, I want to capture the total
execution time from q1 to q3 only. Also, I want to get the time
each query is executed. Is there any way how?
2nd situation (could be any cfml instructions):
<!--- start cfml --->
instruction 1............................
instruction 2............................
instruction 3............................
instruction 4............................
<!--- end cfml --->
In the 2nd situation, I want to get the total execution time
from instruction 1 to instruction 3 only.
Any help is really appreciated. Thanks.
Update ----------------------------------------
By the way, I am using cf 6.1. It seems the gettickcount
technique isn't returning the exact execution time. actually, i
have a code in cf that contains a vbscript. that writes to an excel
file. This is what i did:
start:
..... cf tags here ...
<cfset startTimer = GetTickCount()>
<script language="vbscript">
--- some vbscript and cf statements .........
<cfoutput query = "some_query">
objXL.ActiveSheet.Cells(X_Pos,1).Value = "#some_cf_value#"
objXL.ActiveSheet.Cells(X_Pos,1).Font.size = "#FSize#"
--- some vbscript and cf statements .........
</cfoutput>
--- some vbscript and cf statements .........
</script>
<cfset endTimer = GetTickCount()>
<cfset totalTime_ms = endTimer - startTimer >
end:
totalTime_ms doesn't seem to return the exact length of time
of the process. I mean, From one test, I tried to use a stopwatch
and found out it took about 30 seconds to complete filling the
excel file. But totalTime_ms returns only about 1500 ms, which is
only about 1.5 seconds. The result is far from reality. Why? Is
there any other way? Thanks.

if you wanna know the execution time of the whole page, here
is coding..
put this
<cfset tickBegin = GetTickCount()> on the top row of ur
page.
put this
<cfset tickEnd = GetTickCount()>
<cfset loopTime = tickEnd - tickBegin>
<cfset loopTime = loopTime / 1000>
<cfoutput>Messages Results #count_first# - #count_end#
of about #ListLen(session.topic_replies_list)# for seconds
milliseconds. (#loopTime# seconds)</cfoutput>
at the bottom row of ur page.

Similar Messages

  • Capturing Report Execution Time

    Is there a way to capture how long it took for a report to run?  When you refresh a report, the amount of time it took for the last refresh to complete is displayed, so I know it stores this value.  How can I retrieve it?

    Hello Josh,
    I recommend to post this query to the [BusinessObjects Enterprise Administration|BI Platform; forum.
    This forum is dedicated to topics related to administration and configuration of BusinessObjects Enterprise, BusinessObjects Edge, and Crystal Reports Server.
    It is monitored by qualified technicians and you will get a faster response there.
    Also, all BOE Administration queries remain in one place and thus can be easily searched in one place.
    Best regards,
    Falk

  • Execution time calculation issue

    Hi,
    I have a proceudre which update the tables data and it will capture the execution time for each and every table.
    For that i am using below procedure and its giving incorrect values. i.e., its giving end_time<start_time
    PFB code(Line nos 25,26,33,73,7679,80 code for exeution time calculation) and output.
    1 CREATE OR REPLACE PROCEDURE my_proc
    2 IS
    3 CURSOR c
    4 IS
    5 SELECT tablename, TYPE
    6 FROM table_list;
    7
    8 TYPE emp_record IS RECORD (
    9 empkey tab1.pkey%TYPE,
    10 rid ROWID,
    11 ID tab_join.ID%TYPE,
    12 dt tab_join.dt%TYPE
    13 );
    14
    15 TYPE emp_type IS TABLE OF emp_record
    16 INDEX BY BINARY_INTEGER;
    17
    18 v_emp emp_type;
    19
    20 TYPE emp_type_rowid IS TABLE OF ROWID
    21 INDEX BY BINARY_INTEGER;
    22 tab_no Number:=0;
    23 emp_rowid emp_type_rowid;
    24 r_cur sys_refcursor;
    25 v_start_time TIMESTAMP; /** Added for time calculation*/
    26 v_end_time TIMESTAMP; /** Added for time calculation*/
    27 string1 VARCHAR2 (1000) := 'SELECT b.empkey, b.ROWID rid, a.id id, a.dt dt FROM emp_base a,';
    28 string2 VARCHAR2 (1000) := ' b WHERE a.empkey = b.empkey';
    29 rowcnt Number;
    30BEGIN
    31 FOR c1 IN c
    32 LOOP
    33 tab_no:=tab_no+1;
    34 v_start_time := SYSTIMESTAMP; /** Added for time calculation*/
    35 BEGIN
    36 string_d := string1 || c1.tablename || string2;
    37
    38 OPEN r_cur FOR string_d;
    39
    40 LOOP
    41 FETCH r_cur
    42 BULK COLLECT INTO v_emp LIMIT 50000;
    43
    44 IF v_emp.COUNT > 0
    45 THEN
    46 FOR j IN v_emp.FIRST .. v_emp.LAST
    47 LOOP
    48 emp_rowid (j) := v_emp (j).rid;
    49 END LOOP;
    50
    51 upd_string := ' UPDATE ' || c1.tablename || ' SET id = ' || v_emp (1).ID || 'WHERE ROWID = :emp_rowid';
    52 FORALL i IN emp_rowid.FIRST .. emp_rowid.LAST
    53 EXECUTE IMMEDIATE upd_string
    54 USING emp_rowid (i);
    55 rowcnt := rowcnt + emp_rowid.COUNT;
    56 END IF;
    57
    58 EXIT WHEN v_emp.COUNT < 50000;
    59 v_emp.DELETE;
    60 emp_rowid.DELETE;
    61 END LOOP;
    62
    63 v_emp.DELETE;
    64 emp_rowid.DELETE;
    65
    66 CLOSE r_cur;
    67 EXCEPTION
    68 WHEN OTHERS
    69 THEN
    70 DBMS_OUTPUT.put_line (SQLERRM);
    71 END;
    72
    73 v_end_time := SYSTIMESTAMP; /** Added for time calculation*/
    74
    75 INSERT INTO exec_time
    76 VALUES (tab_no||' '||c1.tablename, v_start_time, v_end_time, v_end_time - v_start_time, rowcnt); /** Added for time calculation*/
    77
    78 COMMIT;
    79 v_start_time := NULL; /** Added for time calculation*/
    80 v_end_time := NULL; /** Added for time calculation*/
    81 rowcnt := 0;
    82 END LOOP;
    83END;
    Output :
    TableName: exec_time
    "TABLE_NAME"      "START_TIME"     "END_TIME"      "EXCUTION_TIME"      "NO_OF_RECORDS_PROCESSED"
    TAB7      5/29/2013 10:52:23.000000 AM      5/29/2013 10:52:24.000000 AM      +00 00:00:00.521707      773
    TAB5      5/29/2013 10:52:18.000000 AM      5/29/2013 10:52:15.000000 AM      -00 00:00:03.381468      56525
    TAB6      5/29/2013 10:52:15.000000 AM      5/29/2013 10:52:23.000000 AM      +00 00:00:08.624420      49078
    TAB2      5/29/2013 10:51:54.000000 AM      5/29/2013 10:51:42.000000 AM      -00 00:00:11.932558      529
    TAB4      5/29/2013 10:51:47.000000 AM      5/29/2013 10:52:18.000000 AM      +00 00:00:31.208966      308670
    TAB1      5/29/2013 10:51:45.000000 AM      5/29/2013 10:51:54.000000 AM      +00 00:00:09.124238      65921
    TAB3      5/29/2013 10:51:42.000000 AM      5/29/2013 10:51:47.000000 AM      +00 00:00:04.502432      12118
    Issue: I am getting execution time in negitive values because end_time<start_time coming.
    Please suggest me how to resolve this.
    Thanks.

    Welcome to the forum!!
    Please read {message:id=9360002} from the FAQ to know the list of details (WHAT and HOW) you need to specify when asking a question.
    I primarily hate 3 things in your code
    1. The way you have used BULK update which is totally unnecessary
    2. COMMIT inside LOOP
    3. The use of WHEN OTHERS exception.
    Your code can be simplified like this
    create or replace procedure my_proc
    is
       v_start_time timestamp;
       v_end_time   timestamp;
       v_rowcnt     integer;
    begin
       for c1 in (
                     select rownum tab_no
                          , tablename
                          , type
                       from table_list
       loop
          sql_string := q'[
                                  merge into #tablename# a
                                  using (
                                          select id, dt
                                            from emp_base
                                        ) b
                                     on (
                                          a.empkey = b.empkey
                                    when matched then
                                        update set a.id = b.id;
          sql_string := replace(sql_string, '#tablename#', c1.tablename);
          v_start_time := systimestamp;
          execute immediate sql_string;
          v_end_time   := systimestamp;
          v_rowcnt     := sql%rowcount;
          insert into exec_time
               values
                    c1.tab_no || ' ' || c1.tablename
                  , v_start_time
                  , v_end_time
                  , v_end_time - v_start_time
                  , v_rowcnt
       end loop;
       commit;
    end; In the INSERT statement on the table EXEC_TIME try to include the column list.
    NOTE: The above code is untested.

  • To track SQL Execution time automatically

    Hi All,
    I have requirement of tracking execution time of for each SQL executed.
    For Eg, If i run command create index, in SQLPLus session, time to execute create index command should be tracked.
    Any idea how to implement this?
    Any help is appreciated.

    899485 wrote:
    You have mistaken me. We have 2 environments. Dev,Prod and QA. 2 or 3?
    So when code is moving to Production we need atleast approx time of deployment of code. Why should there be a relationship between execution times on Prod and Dev?
    Do Prod and Dev have the very same hardware? Same type storage system? Same storage system configuration ito redundancy? Same data volumes? Same processing loads? Are the execution plans the same? Are the Oracle version and patch levels the same? Are the instance and database initialisation settings the same? Etc. etc.
    It may vary but we want approx time. For that we want to capture SQL execution time.So if the Prod execution time is larger than the Dev approx time, then there is a problem?
    How is that a more sensible approach than looking at overall performance and utilisation on Prod, determining the most CPU intensive SQLs, the most I/O intensive SQLs, the most often executed SQLs, and addressing these within the context and environment and h/w and processing loads on Prod?
    Comparing execution times will simply say that the may be a problem. Not that there is a definitive problem. You still need to evaluate that metric and determine if this indicates a problem.
    So seeing that this evaluation needs to be done, why not use better metrics? Like what AWR uses? Like what OEM shows?
    Our application is dataware house application. So before insertion we disable the index and after load we enable index while enabling we capture execution time for enabling.Instrumentation is a different principle. And instrumenting your code to record the process run, the number of rows processed is a sensible approach to keeping track of production run-times, data volumes processed and even failures.
    But I see very little value in taking Dev runtimes and trying to apply that as a benchmark on Prod for identifying performance issues.

  • How to get the total execution time from a tkprof file

    Hi,
    I have a tkprof file. How can I get the total execution time. Going through the file i guess the sum of "Total Waited" would give the total time in the section "Elapsed times include waiting on following events:"
    . The sample of tkprof is given below.
    SQL ID: gg52tq1ajzy7t Plan Hash: 3406052038
    SELECT POSTED_FLAG
    FROM
    AP_INVOICE_PAYMENTS WHERE CHECK_ID = :B1 UNION ALL SELECT POSTED_FLAG FROM
      AP_PAYMENT_HISTORY APH, AP_SYSTEM_PARAMETERS ASP WHERE CHECK_ID = :B1 AND
      NVL(APH.ORG_ID, -99) = NVL(ASP.ORG_ID, -99) AND
      (NVL(ASP.WHEN_TO_ACCOUNT_PMT, 'ALWAYS') = 'ALWAYS' OR
      (NVL(ASP.WHEN_TO_ACCOUNT_PMT, 'ALWAYS') = 'CLEARING ONLY' AND
      APH.TRANSACTION_TYPE IN ('PAYMENT CLEARING', 'PAYMENT UNCLEARING')))
    call     count       cpu    elapsed       disk      query    current        rows
    Parse        1      0.00       0.00          0          0          0           0
    Execute    442      0.08       0.13          0          0          0           0
    Fetch      963      0.22       4.72        350      16955          0         521
    total     1406      0.31       4.85        350      16955          0         521
    Misses in library cache during parse: 1
    Optimizer mode: ALL_ROWS
    Parsing user id: 173     (recursive depth: 1)
    Number of plan statistics captured: 1
    Rows (1st) Rows (avg) Rows (max)  Row Source Operation
             1          1          1  UNION-ALL  (cr=38 pr=3 pw=0 time=139 us)
             1          1          1   TABLE ACCESS BY INDEX ROWID AP_INVOICE_PAYMENTS_ALL (cr=5 pr=0 pw=0 time=124 us cost=6 size=12 card=1)
             1          1          1    INDEX RANGE SCAN AP_INVOICE_PAYMENTS_N2 (cr=4 pr=0 pw=0 time=92 us cost=3 size=0 card=70)(object id 27741)
             0          0          0   NESTED LOOPS  (cr=33 pr=3 pw=0 time=20897 us)
             0          0          0    NESTED LOOPS  (cr=33 pr=3 pw=0 time=20891 us cost=12 size=41 card=1)
             1          1          1     TABLE ACCESS FULL AP_SYSTEM_PARAMETERS_ALL (cr=30 pr=0 pw=0 time=313 us cost=9 size=11 card=1)
             0          0          0     INDEX RANGE SCAN AP_PAYMENT_HISTORY_N1 (cr=3 pr=3 pw=0 time=20568 us cost=2 size=0 card=1)(object id 27834)
             0          0          0    TABLE ACCESS BY INDEX ROWID AP_PAYMENT_HISTORY_ALL (cr=0 pr=0 pw=0 time=0 us cost=3 size=30 card=1)
    Elapsed times include waiting on following events:
      Event waited on                             Times   Max. Wait  Total Waited
      ----------------------------------------   Waited  ----------  ------------
      db file sequential read                       350        0.15          4.33
      Disk file operations I/O                        3        0.00          0.00
      latch: shared pool                              1        0.17          0.17
    ********************************************************************************

    user13019948 wrote:
    Hi,
    I have a tkprof file. How can I get the total execution time.
    call count cpu elapsed disk query current rows
    total 1406 0.31 4.85 350 16955 0 521TOTAL ELAPSED TIME is 4.85 seconds from line above

  • Need to know how to find the last execution time for a function module

    HI all
    I need to know
    1) How to find out the last execution time of the function module ?
      say for eg. I have executed a func. module at 1:39pm. How to retrieve this time  (1:39pm)
    2) I have created 3 billing document in tcode VF01 i.e 3 billing doucment no. would be created in SAP TABLE "VBRP" b/w 12am to 12:30 am.
    How to capture the latest SAP database update b/w time intervals?
    3) Suppose I am downloading TXT file using "GUI_DOWNLOAD" and say in 20th record some error has happened. I can capture the error using the exception.
    Is it possible to run the program once again from 21st records ? All this will be running in background...
    Kindly clarify....
    Points will be rewarded
    Thanks in advance

    1.Use tcode STAT input as Tcode of Fm and execute .
    2. See the billing documents are created in table VBRk header and there will always be Creation date and time.
    VBRk-Erdat "date ., u can check the time field also
    So now if u talk the date and time we can filter then display the records in intervals.
    3. with an error exeption how is my txt download finished .
    once exception is raised there will not be a download .
    regards,
    vijay

  • To capture the passed time in a TimedTrigger UI Element

    Hi, I want to capture the passed time in a TimedTrigger UI Element. I need to capture the passed time from init the application to the execution of an action of a button.
    ¿How can i do it?
    Regards.

    Marcel,
    You do not TimedTrigger for this at all.
    1. Create private variable startTime of type long in custom coding section of view controller (bottom of view controller source between //@begin other .. //@end):
    private long startTime;
    2. In wdDoInit of view controller assign current time:
    startTime = System.currentTimeMillis();
    3. In action handler you may get time passed as following:
    timePassed = System.currentTimeMillis() - startTime;
    The result is in milliseconds, to get seconds divide it by 1000.
    Valery Silaev
    SaM Solutions
    http://www.sam-solutions.net

  • OSB: how to figure out the execution time of OSB proxy

    Trying to figure out how to determine the execution time taken for any given OSB proxy. Seems like the OSB built-in alerting facilities can display the average response time of all calls to a proxy but not individually. Is there a way to dig this out from the monitoring data being collected?

    Service monitoring which comes OOTB is supposed to be aggregated because in usual scenarios you dont need to see the processing time of a specific request. From a performance monitoring perspective the useful data usually is average processing time and minimum or maximum processing time for any request within the aggregation interval which is provided by OSB OOTB.
    Now, in some cases the business might want to track each request individually. So, for example they can track how long did it take to process a specific order. OSB does not provide this feature OOTB. There are multiple ways to get this implemented. Two of the most common ways are:
    1. Add a start and end time capturing in Proxy Services. You can use logging/reporting/publish to a DB etc to achieve this. But this is indeed intrusive and you will need to do this for every Proxy which needs to be monitored at every instance level. This is also a slight overhead in processing in itself.
    2. Use monitoring products which can monitor the WS invocations externally. This will mean more investment but definitely a much better solution. You can consider using different products from Oracle and other vendors based on your requirements, features of products and costs. A few examples are OWSM, Oracle EM, CA Wily etc.

  • "IMAQdxOpenCamera" function execution time is particularly long,why?

    I install VAS2011 in CVI2010 environment, running IMAQdx the samples  <Grab and AttributesSetup>,  "IMAQdxOpenCamera" function execution time is particularly long, more than 7 seconds,why?
    Thanks!
    Solved!
    Go to Solution.

    Thank you for your answers!
    I capture video using VFW initialization faster, only use IMAQdx speed slow.
    thanks!

  • Calculating execution time in the case of refcursor

    I have a package like the one given below.
    create or replace package scott_test is
    type ref_cursor is ref cursor;
    procedure scott_test(p_dno in number, p_cursor out ref_cursor );
    end scott_test;
    CREATE OR REPLACE package body scott_test is
    procedure scott_test(p_dno in number, p_cursor out ref_cursor )is
    begin
         OPEN p_cursor FOR
         select empno,ename,dname from emp natural join dept where deptno=p_dno;
    end;
    end scott_test ;
    If i execute the sp by
    var x refcursor
    execute scott_test.scott_test(10,:x)
    it will return all rows selected by the query.
    I want to know the exact time it will take when i execute the sp in this package. Since this returns a ref cursor the fetch happens only when we execute this sp.
    Which is the best way of capturing execution time in refcursor usage?

    I hope you are looking for this way?
    SQL> VAR V REFCURSOR
    SQL> create or replace procedure timetest(r out sys_refcursor) as
      2  st  PLS_INTEGER;
      3  nt  PLS_INTEGER;
      4  begin
      5  st:= dbms_utility.get_time;
      6  open r for select * from all_objects;
      7  nt:= dbms_utility.get_time;
      8  dbms_output.put_line( nt-st ||' elapsed');
      9  end timetest;
    10  /
    Procedure created.
    SQL> EXECUTE TIMETEST(:V);
    3 elapsed
    PL/SQL procedure successfully completed.

  • Loading jar files at execution time via URLClassLoader

    Hello�All,
    I'm�making�a�Java�SQL�Client.�I�have�practicaly�all�basic�work�done,�now�I'm�trying�to�improve�it.
    One�thing�I�want�it�to�do�is�to�allow�the�user�to�specify�new�drivers�and�to�use�them�to�make�new�connections.�To�do�this�I�have�this�class:�
    public�class�DriverFinder�extends�URLClassLoader{
    ����private�JarFile�jarFile�=�null;
    ����
    ����private�Vector�drivers�=�new�Vector();
    ����
    ����public�DriverFinder(String�jarName)�throws�Exception{
    ��������super(new�URL[]{�new�URL("jar",�"",�"file:"�+�new�File(jarName).getAbsolutePath()�+"!/")�},�ClassLoader.getSystemClassLoader());
    ��������jarFile�=�new�JarFile(new�File(jarName));
    ��������
    ��������/*
    ��������System.out.println("-->"�+�System.getProperty("java.class.path"));
    ��������System.setProperty("java.class.path",�System.getProperty("java.class.path")+File.pathSeparator+jarName);
    ��������System.out.println("-->"�+�System.getProperty("java.class.path"));
    ��������*/
    ��������
    ��������Enumeration�enumeration�=�jarFile.entries();
    ��������while(enumeration.hasMoreElements()){
    ������������String�className�=�((ZipEntry)enumeration.nextElement()).getName();
    ������������if(className.endsWith(".class")){
    ����������������className�=�className.substring(0,�className.length()-6);
    ����������������if(className.indexOf("Driver")!=-1)System.out.println(className);
    ����������������
    ����������������try{
    ��������������������Class�classe�=�loadClass(className,�true);
    ��������������������Class[]�interfaces�=�classe.getInterfaces();
    ��������������������for(int�i=0;�i<interfaces.length;�i++){
    ������������������������if(interfaces.getName().equals("java.sql.Driver")){
    ����������������������������drivers.add(classe);
    ������������������������}
    ��������������������}
    ��������������������Class�superclasse�=�classe.getSuperclass();
    ��������������������interfaces�=�superclasse.getInterfaces();
    ��������������������for(int�i=0;�i<interfaces.length;�i++){
    ������������������������if(interfaces[i].getName().equals("java.sql.Driver")){
    ����������������������������drivers.add(classe);
    ������������������������}
    ��������������������}
    ����������������}catch(NoClassDefFoundError�e){
    ����������������}catch(Exception�e){}
    ������������}
    ��������}
    ����}
    ����
    ����public�Enumeration�getDrivers(){
    ��������return�drivers.elements();
    ����}
    ����
    ����public�String�getJarFileName(){
    ��������return�jarFile.getName();
    ����}
    ����
    ����public�static�void�main(String[]�args)�throws�Exception{
    ��������DriverFinder�df�=�new�DriverFinder("D:/Classes/db2java.zip");
    ��������System.out.println("jar:�"�+�df.getJarFileName());
    ��������Enumeration�enumeration�=�df.getDrivers();
    ��������while(enumeration.hasMoreElements()){
    ������������Class�classe�=�(Class)enumeration.nextElement();
    ������������System.out.println(classe.getName());
    ��������}
    ����}
    It�loads�a�jar�and�searches�it�looking�for�drivers�(classes�implementing�directly�or�indirectly�interface�java.sql.Driver)�At�the�end�of�the�execution�I�have�found�all�drivers�in�the�jar�file.
    The�main�application�loads�jar�files�from�an�XML�file�and�instantiates�one�DriverFinder�for�each�jar�file.�The�problem�is�at�execution�time,�it�finds�the�drivers�and�i�think�loads�it�by�issuing�this�statement�(Class�classe�=�loadClass(className,�true);),�but�what�i�think�is�not�what�is�happening...�the�execution�of�my�code�throws�this�exception
    java.lang.ClassNotFoundException:�com.ibm.as400.access.AS400JDBCDriver
    ��������at�java.net.URLClassLoader$1.run(URLClassLoader.java:198)
    ��������at�java.security.AccessController.doPrivileged(Native�Method)
    ��������at�java.net.URLClassLoader.findClass(URLClassLoader.java:186)
    ��������at�java.lang.ClassLoader.loadClass(ClassLoader.java:299)
    ��������at�sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:265)
    ��������at�java.lang.ClassLoader.loadClass(ClassLoader.java:255)
    ��������at�java.lang.ClassLoader.loadClassInternal(ClassLoader.java:315)
    ��������at�java.lang.Class.forName0(Native�Method)
    ��������at�java.lang.Class.forName(Class.java:140)
    ��������at�com.marmots.database.DB.<init>(DB.java:44)
    ��������at�com.marmots.dbreplicator.DBReplicatorConfigHelper.carregaConfiguracio(DBReplicatorConfigHelper.java:296)
    ��������at�com.marmots.dbreplicator.DBReplicatorConfigHelper.<init>(DBReplicatorConfigHelper.java:74)
    ��������at�com.marmots.dbreplicator.DBReplicatorAdmin.<init>(DBReplicatorAdmin.java:115)
    ��������at�com.marmots.dbreplicator.DBReplicatorAdmin.main(DBReplicatorAdmin.java:93)
    Driver�file�is�not�in�the�classpath�!!!�
    I�have�tried�also�(as�you�can�see�in�comented�lines)�to�update�System�property�java.class.path�by�adding�the�path�to�the�jar�but�neither...
    I'm�sure�I'm�making�a/some�mistake/s...�can�you�help�me?
    Thanks�in�advice,
    (if�there�is�some�incorrect�word�or�expression�excuse�me)

    Sorry i have tried to format the code, but it has changed   to �... sorry read this one...
    Hello All,
    I'm making a Java SQL Client. I have practicaly all basic work done, now I'm trying to improve it.
    One thing I want it to do is to allow the user to specify new drivers and to use them to make new connections. To do this I have this class:
    public class DriverFinder extends URLClassLoader{
    private JarFile jarFile = null;
    private Vector drivers = new Vector();
    public DriverFinder(String jarName) throws Exception{
    super(new URL[]{ new URL("jar", "", "file:" + new File(jarName).getAbsolutePath() +"!/") }, ClassLoader.getSystemClassLoader());
    jarFile = new JarFile(new File(jarName));
    System.out.println("-->" + System.getProperty("java.class.path"));
    System.setProperty("java.class.path", System.getProperty("java.class.path")+File.pathSeparator+jarName);
    System.out.println("-->" + System.getProperty("java.class.path"));
    Enumeration enumeration = jarFile.entries();
    while(enumeration.hasMoreElements()){
    String className = ((ZipEntry)enumeration.nextElement()).getName();
    if(className.endsWith(".class")){
    className = className.substring(0, className.length()-6);
    if(className.indexOf("Driver")!=-1)System.out.println(className);
    try{
    Class classe = loadClass(className, true);
    Class[] interfaces = classe.getInterfaces();
    for(int i=0; i<interfaces.length; i++){
    if(interfaces.getName().equals("java.sql.Driver")){
    drivers.add(classe);
    Class superclasse = classe.getSuperclass();
    interfaces = superclasse.getInterfaces();
    for(int i=0; i<interfaces.length; i++){
    if(interfaces[i].getName().equals("java.sql.Driver")){
    drivers.add(classe);
    }catch(NoClassDefFoundError e){
    }catch(Exception e){}
    public Enumeration getDrivers(){
    return drivers.elements();
    public String getJarFileName(){
    return jarFile.getName();
    public static void main(String[] args) throws Exception{
    DriverFinder df = new DriverFinder("D:/Classes/db2java.zip");
    System.out.println("jar: " + df.getJarFileName());
    Enumeration enumeration = df.getDrivers();
    while(enumeration.hasMoreElements()){
    Class classe = (Class)enumeration.nextElement();
    System.out.println(classe.getName());
    It loads a jar and searches it looking for drivers (classes implementing directly or indirectly interface java.sql.Driver) At the end of the execution I have found all drivers in the jar file.
    The main application loads jar files from an XML file and instantiates one DriverFinder for each jar file. The problem is at execution time, it finds the drivers and i think loads it by issuing this statement (Class classe = loadClass(className, true);), but what i think is not what is happening... the execution of my code throws this exception
    java.lang.ClassNotFoundException: com.ibm.as400.access.AS400JDBCDriver
    at java.net.URLClassLoader$1.run(URLClassLoader.java:198)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:186)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:299)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:265)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:255)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:315)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:140)
    at com.marmots.database.DB.<init>(DB.java:44)
    at com.marmots.dbreplicator.DBReplicatorConfigHelper.carregaConfiguracio(DBReplicatorConfigHelper.java:296)
    at com.marmots.dbreplicator.DBReplicatorConfigHelper.<init>(DBReplicatorConfigHelper.java:74)
    at com.marmots.dbreplicator.DBReplicatorAdmin.<init>(DBReplicatorAdmin.java:115)
    at com.marmots.dbreplicator.DBReplicatorAdmin.main(DBReplicatorAdmin.java:93)
    Driver file is not in the classpath !!!
    I have tried also (as you can see in comented lines) to update System property java.class.path by adding the path to the jar but neither...
    I'm sure I'm making a/some mistake/s... can you help me?
    Thanks in advice,
    (if there is some incorrect word or expression excuse me)

  • Unable to capture the Idle time for BSP page

    Hi Experts,
    I want to capture the Idle time of my BSP page. If that is 5 mins then i have to display the pop up displaying the remaining time.
    Please let me know how to capture the IDLE TIME. not the time after the page is loaded.
    Any suggestion will be helpful.
    Aready checked in SDN but unable to get the solution so posting it.
    Thanks in advance.
    Sravanthi.V

    hi,
    After capturing the idle time iam giving the warning popup to user before 5mins of expiry.Now my requirement is if the user clicks on OK button of popup the page should get refresh. i.e.Idle time should of system should break and we have to get one more hour for expiry.
    Thanks in advance,
    Sravanthi.V

  • How to get the execution time of a Discoverer Report from qpp_stats table

    Hello
    by reading some threads on this forum I became aware of the information stored in eul5_qpp_stats table. I would like to know if I can use this table to determine the execution time of a worksheet. In particular it looks like the field qs_act_elap_time stores the actual elapsed time of each execution of specific worksheet: am I correct? If so, how is this value computed? What's the unit of measure? I assume it's seconds, but then I've seen that sometimes I get numbers with decimals.
    For example I ran a worksheet and it took more than an hour to run, and the value I get in the qs_act_elap_time column is 2218.313.
    Assuming the unit of measure was seconds than it would mean approx 37 mins. Is that the actual execution time of the query on the database? I guess the actual execution time on my Discoverer client was longer since some calculations were performed at the client level and not on the database.
    I would really appreciate if you could shed some light on this topic.
    Thanks and regards
    Giovanni

    Thanks a lot Rod for your prompt reply.
    I agree with you about the accuracy of the data. Are you aware of any other way to track the execution times of Discoverer reports?
    Thanks
    Giovanni

  • How to improve the execution time of my VI?

    My vi does data processing for hundreds of files and takes more than 20 minutes to commplete. The setup is firstly i use the directory LIST function to list all the files in a dir. to a string array. Then I index this string array into a for loop, in which each file is opened one at a time inside the loop, and some other sub VIs are called to do data analysis. Is there a way to improve my execution time? Maybe loading all files into memory at once? It will be nice to be able to know which section of my vi takes the longest time too. Thanks for any help.

    Bryan,
    If "read from spreadsheet file" is the main time hog, consider dropping it! It is a high-level, very multipurpose VI and thus carries a lot of baggage around with it. (you can double-click it and look at the "guts" )
    If the files come from a just executed "list files", you can assume the files all exist and you want to read them in one single swoop. All that extra detailed error checking for valid filenames is not needed and you never e.g. want it to popup a file dialog if a file goes missing, but simply skip it silently. If open generates an error, just skip to the next in line. Case closed.
    I would do a streamlined low level "open->read->close" for each and do the "spreadsheet string to array" in your own code, optimized to the exact format of your files. For example, notice that "read from spreadheet file" converts everything to SGL, a waste of CPU if you later need to convert it to DBL for some signal processing anyway.
    Anything involving formatted text is not very efficient. Consider a direct binary file format for your data files, it will read MUCH faster and take up less disk space.
    LabVIEW Champion . Do more with less code and in less time .

  • How to find out the execution time of a sql inside a function

    Hi All,
    I am writing one function. There is only one IN parameter. In that parameter, i will pass one SQL select statement. And I want the function to return the exact execution time of that SQL statement.
    CREATE OR REPLACE FUNCTION function_name (p_sql IN VARCHAR2)
    RETURN NUMBER
    IS
    exec_time NUMBER;
    BEGIN
    --Calculate the execution time for the incoming sql statement.
    RETURN exec_time;
    END function_name;
    /

    Please note that wrapping query in a "SELECT COUNT(*) FROM (<query>)" doesn't necessarily reflect the execution time of the stand-alone query because the optimizer is smart and might choose a completely different execution plan for that query.
    A simple test case shows the potential difference of work performed by the database:
    Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production
    Session altered.
    SQL>
    SQL> drop table count_test purge;
    Table dropped.
    Elapsed: 00:00:00.17
    SQL>
    SQL> create table count_test as select * from all_objects;
    Table created.
    Elapsed: 00:00:02.56
    SQL>
    SQL> alter table count_test add constraint pk_count_test primary key (object_id)
    Table altered.
    Elapsed: 00:00:00.04
    SQL>
    SQL> exec dbms_stats.gather_table_stats(ownname=>null, tabname=>'COUNT_TEST')
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:00.29
    SQL>
    SQL> set autotrace traceonly
    SQL>
    SQL> select * from count_test;
    5326 rows selected.
    Elapsed: 00:00:00.10
    Execution Plan
    Plan hash value: 3690877688
    | Id  | Operation         | Name       | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT  |            |  5326 |   431K|    23   (5)| 00:00:01 |
    |   1 |  TABLE ACCESS FULL| COUNT_TEST |  5326 |   431K|    23   (5)| 00:00:01 |
    Statistics
              1  recursive calls
              0  db block gets
            419  consistent gets
              0  physical reads
              0  redo size
         242637  bytes sent via SQL*Net to client
           4285  bytes received via SQL*Net from client
            357  SQL*Net roundtrips to/from client
              0  sorts (memory)
              0  sorts (disk)
           5326  rows processed
    SQL>
    SQL> select count(*) from (select * from count_test);
    Elapsed: 00:00:00.00
    Execution Plan
    Plan hash value: 572193338
    | Id  | Operation             | Name          | Rows  | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT      |               |     1 |     5   (0)| 00:00:01 |
    |   1 |  SORT AGGREGATE       |               |     1 |            |          |
    |   2 |   INDEX FAST FULL SCAN| PK_COUNT_TEST |  5326 |     5   (0)| 00:00:01 |
    Statistics
              1  recursive calls
              0  db block gets
             16  consistent gets
              0  physical reads
              0  redo size
            412  bytes sent via SQL*Net to client
            380  bytes received via SQL*Net from client
              2  SQL*Net roundtrips to/from client
              0  sorts (memory)
              0  sorts (disk)
              1  rows processed
    SQL>As you can see the number of blocks processed (consistent gets) is quite different. You need to actually fetch all records, e.g. using a PL/SQL block on the server to find out how long it takes to process the query, but that's not that easy if you want to have an arbitrary query string as input.
    Regards,
    Randolf
    Oracle related stuff blog:
    http://oracle-randolf.blogspot.com/
    SQLTools++ for Oracle:
    http://www.sqltools-plusplus.org:7676/
    http://sourceforge.net/projects/sqlt-pp/

Maybe you are looking for

  • Urgent(abap runtime error)

    hi all, when i tried to findout the name(collective search) by  last name o'brien in PA20 OR PA30 transacton   i got the abap runtime  error  in production but when i tried samething in development and quality  by lastname  o'brein in PA20 OR PA30 TR

  • How to view weblogic log files from a browser

    Hi, I am running WebLogic Server 7.03 on Solaris 8. I have one Admin and multiple Managed servers running. Each creates its own log file. Is there anyway I can access this log files from the browser ? In Apache, you can create a link from htdocs dir

  • Hyperlink to webpage not working??

    I am attempting to make a hyperlink (to a webpage) of an object on a slide (a circle). After clicking on the object, opening the Inspector, checking "Enable as a Hyperlink" and then beginning to type the URL in the proper place, the Inspector box imm

  • Custom properties files in enterprise project

    Hi, I created a enterprise application containing 3 projects: - EAR project - EJB project - Web project And I added a properties file in : -EAR project/EarContent/APP-INF/afile.properties The content of this file is : Host=<path to host> Port=389 And

  • Avaya Phone in same VLAN as workstation

    Ok so here is my dilema, Avaya Phone with Docking station plugged in to it, dot1q passes the workstation fine, but hangs the phone. With out creating a voice vlan is there any way I can have the phone authenticat with mab, and the workstation with do