How to find size of ResultSet in JAVA

hi ,
I have one problem... went for sun API but i did not get any solution....please any body help me... my problem is ......
I got the data from DataBase by executing a query . so my Resultset having some records.Now my problem is how to find the size of ResultSet.without converting into list or without wile loop I want to find out size of my ResultSet
..... Is there any predefined method for that;
thanks in advance

gbabu wrote:
hay.... again you are diverting from topic. my problem is how to find resultset size.... not for how to write query for counting records.Of cousre he is. Because the answer to your question is: it can't be done. So he's kindly moved on, and offered you an alternative way to achieve what you want. If that offends you, I suggest you have your head in an uncomfortable and unsuitable orifice
Why are you so desperate to know the size of the ResultSet anyway? If you've got limits on the size of ResultSet that's acceptable, you can adjust your query to limit the number of rows returned. if you simply need to know how many rows there are, pulling the entire content of the table(s) back and counting them afterwards is horrifically inefficient. If you need to know to so you can prepare a datastructure to put the results in, maybe you've chosen the wrong structure (I'm thinking 'array' here). You might have a legitimate reason to find out the size of a ResultSet, I don't know. But the ResultSet interface doesn't give you that option, so you're on a hiding to nothing, and might as well use the suggested alternative, or reconsider your requirement

Similar Messages

  • How to find the Latency time in java.

    How to find the Latency time in java.

    long start = System.currentTimeMillis();
    doTheWork();
    long durationInMillis = System.currentTimeMillis() - start;You might repeat doTheWork() several (100-1000 or more) times if it is fast and the granularity of your system clock is not good enough.

  • How to find the  System Dbtype in java code

    How to find the System Dbtype in java code
    I need various Db connection my project (oracle, sq l,sybase,db2),So How to find the System Dbtype in java code

    Welcome to the Forums.
    Please go through the FAQ of the Forum.
    You has posted your query in the wrong Forum, this one is dedicated to Oracle Forms.
    Please try {forum:id=1050}.
    Regards,

  • How to find size of each RMAN backup

    friends,
    How to find size of each RMAN backup? Everyday we r taking rman hotbackup and need to find size of each day backup? Is there any dba views ?
    Thanks in advance

    Or start rman target / rcvcat rman/rman@catalogdb
    and use the command:
    RMAN> list backup;
    Output should look like:
    BS Key Type LV Size Device Type Elapsed Time Completion Time
    8152318 Full *38.72G* SBT_TAPE 02:05:35 20-APR-09
    BP Key: 8152322 Status: AVAILABLE Compressed: NO Tag: FULL_BK_DB
    Handle: df_WCSPRD_t684630039_s1757_p1 Media:
    List of Datafiles in backup set 8152318
    File LV Type Ckp SCN Ckp Time Name
    1 Full 4657366129868 19-APR-09 /opt/test/db01/system01.dbf
    2 Full 4657366129868 19-APR-09 /opt/test/db01/undotbs01.dbf
    3 Full 4657366129868 19-APR-09 /opt/test/db01/sysaux01.dbf
    4 Full 4657366129868 19-APR-09 /opt/test/db01/users01.dbf
    5 Full 4657366129868 19-APR-09 /opt/test/db01/testc01.dbf
    6 Full 4657366129868 19-APR-09 /opt/test/db01/test01.dbf
    7 Full 4657366129868 19-APR-09 /opt/test/db01/testc02.dbf
    See bold text for backup piece size

  • How to find PL/SQL dependent on Java stored in database

    Is there a way to find out - which JAVA CLASS object a PL/SQL package calls?
    I have a PL/SQL package with a function F. The definition goes like this:
    PACKAGE P
    IS
    FUNCTION F ( n NUMBER )
    RETURN VARCHAR2
    AS
    LANGUAGE JAVA
    NAME 'com.foo.ServiceWrapper.getF(int) return java.lang.String';
    END P;
    And I expected to find the relationship between the JAVA CLASS and the PL/SQL package listed in DBA_DEPENDENCIES:
    SELECT *
    FROM DBA_DEPENDENCIES
    WHERE REFERENCED_TYPE = 'JAVA CLASS'
    AND NAME = 'P';
    But nothing shows up. Do you know, where to look?
    /Jorn

    You can go to the 'Program' 'Executable' Form and enter the search on the shortname. I don't think you have to modify the code though.
    I think you should look at metalink note 281877.1 and probably apply patch 2968357. Or at least modify the offending tablespace default parameters.

  • How to find out memory of a java card

    is there anyone could tell me that how can we check the size of the memory of a card? thank you in advance:D

    If the card is a Java Card 2.2.1, create an applet that returns
    JCSystem.getAvailableMemory(), install and queryit.
    Some other ideas for getting the free memory on card were presented in the thread "Java Forums - Free memory on card"
    http://forum.java.sun.com/thread.jspa?threadID=647894&tstart=30
    Jan

  • How to find size of bundle?

    hi all,
    i am making a vi in which the input is a bundle containing unknown
    number of elements (string and double 1d and 2d arrays), i want to
    unbundle it and then write in matfile format, i need to know how many
    elements and the type of each element and then i can write them using a
    for loop and writing for each element.
    please give me suggestion how to do it and if somebody has any example please attach.
    thank you

    Hi,
    I'm not sure if you already have the cluster made or not... but an easy way to find and display what is inside, is to right click the cluster icon on the back panel > create > indicator.  This will automatically configure the indicator so that it dispalys everything correctly.
    Also if you need to see the elements individually, use the unbundle command.  Again to create indicators for each element of the unbundle, you can right click > create > indicator, like I have shown in the attached image.  This image demonstrates how to create an numeric indicator off of the array size module.
    Hope that helps.
    Attachments:
    cluster.JPG ‏20 KB

  • How to find Size of the fact table?

    hello all
    how do i find out the size of the fact table?
    Is the size of the fact table is same as size of the cube.
    pls let meknow
    regards
    balji

    Hello Balaji,
    To find out size of fact table
    DB02 ->Detailed anaysis -> Fact table name
    It will show you the details.
    The size of cube is not exactly equal to the size of fact table, but usually as fact table is much more larger than dimension tables, fact table size will give you a fair idea about cube size.
    Hope it helps.
    Regards,
    Praveen

  • How to find Size of  Dimension Table

    Hi
      I just need to Find the Size of Dimension Table and Fact Table also .
    Thanks
    Bhanuprakash

    Infocube ->Manage -> Contents -> when it as for table name enter /finfocube name and click on no. of entries you will know how many records are in fact table. if you think the cube is being compressed enter /einfocube name
    for Dimension enter /D dimension name and click on no of entires. you will know how many records are in dimension.
    to know the name of the dimension Infocube ->change -> click on dimensions -> further details about dimensions click on Assign tab
    hope this help!
    Rafi

  • How to find particular CRM BAPIs from Java code of ISA B2B application?

    Hi Guys,
    I am newbie in CRM ISA field. I am supporting CRM ISA 5.0 B2B application.
    Basically I had a question about how to go about finding the BAPIs which are getting called from the Java side of ISA.
    I know that the framework uses JCO connection in order to execute BAPIs in the back-end and usually these BAPIs are standard.
    So I can put a break-point on the CRM bapis and see which is called when.
    But if I want to track BAPIs from Java code, what should be my approach?
    Please help.
    Thanks!

    Hi,
    To setup the trace logs you need to use the following URL.
    https://<system domain name>:port/<application_name>/admin
    typically it should look like as below:
    https://abc.com:50001/b2b/admin
    Here there is an option to start and stop the logs and after stopping it will generate a Zip file which you need to download and from there you can easily find out the BAPI's or teh RFC calls.
    Also when you search you should alwways keep one thing mind that these FM's normally start with CRM_ISA*
    Hope it helps.
    Regards
    Sidd

  • How to find out that we have Java machine on our computer (Windows)

    I want to make setup prog which will search for Java machine (NOT ONLY SUN BUT ALSO OTHERS) and if it can't find any, it will install new in a bonus.

    I don't have JAVA_HOME environment variable but i am sure i have java machine =)Yeah, kinda what I said. [url http://www.google.nl/search?q=get+list+of+installed+software]This search looked promising, though I haven't looked into it very deep.
    Kind regards,
      Levi

  • How to find size of the plsql packages

    Oracle : 10.2.0.4
    Os : Solaris
    Issue : DB has around 2000 packages which are in development mode. In case If we want to find the size of all the packages what is the mechanism from the dictionary tables. ?
    Is there way the size is being stored in the dictionary tables ?
    Pl. let me know.

    [email protected] wrote:
    Issue : DB has around 2000 packages which are in development mode. In case If we want to find the size of all the packages what is the mechanism from the dictionary tables. ?
    Is there way the size is being stored in the dictionary tables ?Source code is stored in the dictionary table sys.source$ - it is a very basic table with only 3 columns. OBJ# refers to the object in sys.objects$, LINE is the source code line number and SOURCE contains the line of source code.
    So you can use the LENGTH() function and SUM() that and group by object to get each object's size. But this will be pretty meaningless as source code is not what is loaded and executed - compiled (aka p-code ) is loaded into memory and executed.
    Obviously, more source code means a bigger sys.source$ table - but that is fairly easily addressed by ensuring that the SYSTEM tablespace is large enough.

  • How to find the Execution Time for Java Code?

    * Hi everyone , i want to calculate the execution time for my process in java
    * The following was the ouput for my coding,
    O/P:-
    This run took 0 Hours ;1.31 Minutes ;78.36 Seconds
    *** In the above output , the output should come exactly what hours , minutes and seconds for my process,
    but in my code the minutes are converted into seconds(It should not)...
    * Here is my coding,
        static long start_time;
        public static void startTime()
            start_time = System.currentTimeMillis();
        public static void endTime()
            DecimalFormat df = new DecimalFormat("##.##");
            long end_time = System.currentTimeMillis();
            float t = end_time - start_time;
            float sec = t / 1000;
            float min = 0, hr = 0;
            if (sec > 60) {
                min = sec / 60;
            if (min > 60) {
                hr = min / 60;
            System.out.println("This run took " + df.format(hr) + " Hours ;"+ df.format(min) + " Minutes ;" + df.format(sec) + " Seconds");
        }* How to Calcualte exact timing for my process....
    * Thanks

    * Hi flounder, Is following code will wotk perfectly?
         public static void endTime()
              DecimalFormat df = new DecimalFormat("##.##");
              long end_time = System.currentTimeMillis();
              float t = end_time - start_time;
              float sec = t / 1000;
              float min = 0, hr = 0;
              while(sec >= 60){
         min++;
         sec = sec -60;
         if (min >= 60){
         min = 0; //or min = min -60;
         hr++;
              System.out.println("This run took " + df.format(hr) + " Hours ;"+ df.format(min) + " Minutes ;" + df.format(sec) + " Seconds");
         }

  • How to find Free disk space using Java program ?

    Hi friends,
    I need to find out the Free Hard disk Space to alert the user and send them mail if hard drive is about 85% full.
    i am developing databackup program in which i have to check it , if hard drive is fulled with 85% or remain left space is less email sent to user to notify and delete older backups.
    give me solution using java program...
    please
    Help me i need it in recent...

    Hi friends,
    I need to find out the Free Hard disk Space to alert
    the user and send them mail if hard drive is about
    85% full.
    i am developing databackup program in which i have to
    check it , if hard drive is fulled with 85% or remain
    left space is less email sent to user to notify and
    delete older backups.
    give me solution using java program...
    please
    Help me i need it in recent...

  • JAVA classpath: How to find classpath for a given java process

    I want to find the classpath for java process outside of the process.
    example:
    Lets say I execute the following command
    java -classpath foobar.jar;shoobar.jar javatest
    Is there a way to find the classpath from a different program given the process id that is created for the above command?
    Ami shukla

    Perhaps through an externally connected debugger? Beyond that, the only thing I can think of would be to modify the source to report that information for you.

Maybe you are looking for

  • Urgent 100 days selective deletion & loading

    Hi All, we have some issues regarding our architecture, now we are going to stabilize our project can any one through light how to solve these issues. Changes done for Service ticket, 100 days after the Creation date is not reflected in BW If service

  • Using s video cable

    i hooked up my powerbook through my tv, and it works, i watched quicktime files on the tv. I was wondering if their is a way so that when i edit with final cut pro, i can have the canvas window displayed on the tv. there is probably some setting that

  • How to upload a excel file using BDC

    how should i upload a file using BDC i have downloaded a excel file containing the values of  table A006 a X server. now i hav to upload it into new server Y server using BDC , how do i do it? wat all things one shud consider ?

  • Problem is releasing excel application from memory using webutil

    Hi Experts, This code is working fine but it is not releasing the excel from the memory. if i try the same set of code with Wort.Applicationa or Access.Application it works fine. But only with excel it is not working. Is there is any way to kill the

  • JDBC Synchronous ?

    Hi Is it possible to use JDBC adapter synchronous mode ? If so, how do we use it ?