How can I get the size of all lines or the last line number in a DB?

I want to display a certain number of lines from a DB.
But before I fetch them out, I must know how many lines of this DB has.
I donnot know if there is some methods have this function. I know the last() method can move the cursor to the last line, but some DB cannot support this function.
Could someone know the answer or some examples about displaying data in a jsp?
Thanks a lot.

To get the number of rows in a ResultSet, loop over the result set with while(res.next()). Read each row into an object. Add each object into a, say, LinkedList. At the end, you will have the rows nicely converted to objects (which you probably should do anyway), and list.size() will give the number of objects.
There are other ways to get the number of objects, but list.size() is the easy and reliable way. If you don't need the rows converted to objects ...why did you select them in the first place?
Tricks with last() and whatnot sort of work. They read the entire result set into memory. But you'll need to write the while(res.next()) loop anyway. No point in having the computer do the same thing twice.

Similar Messages

  • HOW CAN I GET A DESCRIPTION OF ALL OF THE FRATURES IN lION 10.7.4

    How can I get a description of all of the programs that came with my mac pro without spending an arm and a leg?

    This is a good place to start and follow the links to all the Mac 101 articles.
    http://www.apple.com/support/mac101/
    Regards,
    Captfred

  • My friend synced a video to my ipod but it erased all my data on my ipod,but i cant figure out how to load my old libray back without deleting the movie. my friend cant tell me the password. How can I get my old library back without deleting the movie?

    My friend synced a video to my ipod but it earased all my data on my ipod,but I can't figure out how to load my old library back without deleting the movie. My friend shares a family account so she can't tell me the password. How can i get my old library back without deleting the movie?

    Linnwarner wrote:
    She does have the right because she bought the movie.
    Not true at all.
    You only buy the right to your own personal use.
    You do NOT have the right to distribute to others.
    This is illegal.  There is no doubt about it

  • I moved iTunes folder location, now all my personal song ratings and playlists are gone.  How can I get them back?  All the iTunes files are intact, just in a new location.  Running iTunes 11.1.5.5

    I moved iTunes folder location, now all my personal song ratings and playlists are gone.  How can I get them back?  All the iTunes files are intact, just in a new location.  Running iTunes 11.1.5.5 on Windows 7

    Put everything back the way it was.
    Them move the folder correctly.
    http://support.apple.com/kb/ht1364

  • How can I get a reference to all controls on a front panel of one type )for example of the type Text Ring?

    I'd like to set the strings[] property of all the Text Ring controls on a front panel at once without creating a property node for every text ring. How can i do that?

    > How can I get a reference to all controls on a front panel of one type
    > )for example of the type Text Ring?
    >
    > I'd like to set the strings[] property of all the Text Ring controls
    > on a front panel at once without creating a property node for every
    > text ring. How can i do that?
    This is likely more complicated than making property nodes for each
    ring, but you can do it. Make a subVI that takes in a panel reference,
    reads the array of control references, loops through them looking for
    rings, and modifying the Strings[] property on each ring.
    The part of this that will probably be the least obvious, when you
    have an array of control references there are two ways to find out
    if an element is a ring. You can read the classID and compare it
    to the cla
    ssID of a true ring control. An alternative is to cast
    the control reference to a ring control using a Cast to more specific
    node and wire the error out to a case structure. The error case is
    where the objects that aren't rings will go. The success case case
    where you will have a valid ring refnum that you can use to modify
    the strings.
    Greg McKaskle

  • I am having problems with the InDesign it won't download it keeps saying extract when its about 30% then it says failed. How can i get it to download all the way?

    I am having problems with the InDesign it won't download it keeps saying extract when its about 30% then it says failed. How can i get it to download all the way?

    Basic troubleshooting from the User's Guide is reset, restart, restore (first from backup then as new).  Try each of these in order until the issue is resolved.

  • My iphone has calendar history for 10 years.  my icloud only shows about 6-8 weeks back.  how can i get icloud to show all the calendar events in the past that are on iphone?

    my iphone has calendar history for 10 years.  my icloud only shows about 6-8 weeks back.  how can i get icloud to show all the calendar events in the past that are on iphone?

    I encountered a similar problem when finally (and with much regret) I was obliged to migrate my MobileMe to iCloud last month.
    Many years of iCal history vanished without trace during this automated transition by Apple and iCloud then kindly synched the resulting vacuum back to iCal on my Mac.
    Fortunately, iCloud wasn’t able to decimate iCal on my other Macs because (1) they are still running Snow and (2) I had switched them off as a precaution.  Good job I did.
    My solution was to export my iCal data on one of those other Macs to a backup file – then I imported that backup file into my Lion-updated Mac’s iCal. That restored all the iCloud-deleted iCal data back on to my Mac and this was promptly synched automatically to my Calendar on iCloud.  So now it’s all there and showing.
    Perhaps you could do something similar?  In the meantime, be very careful not to let iCloud’s amnesia get synched to your iPhone (and other devices).
    Experience has taught me never to trust an “upgrade” until it is proven to be working correctly and always to keep in reserve another Mac with a properly-functioning system and all synching to it switched off...

  • How can I get my books that I download from the Library that are WMA files into my I tunes so I can listen to them

    How can I get my books that I download from the Library that are WMA files into my I tunes so I can listen to them. They have a ton of books but I can only listen to them from my windows media player and I wouldlove to download to my I pod but I have tried everything I can think of it they won't go over.  Someone said all I had to do was copy them over and they would convert but I can't even get them to copy.  Thanks.

    Well it started happening AGAIN with my 2nd IPod. No matter what I did, it Itunes would NOT restore it!
    I finally installed Itunes on my hubby's PC at work and managed to get it restored there.
    Apparently, there must be some sort of compatibility issue with the windows version of Itunes and some other piece of software on my pc.
    And one more important thing! I had to follow the instructions in the other thread that talks about how to correctly uninstall itunes and quicktime, in order to completely eliminate ALL traces of my "first" ipod's existence so it wouldn't demand that I restore it.
    I think the software got "confused" and thought when I connected my 2nd ipod, that it was the 1st and that it still needed to be restored.
    Basically, this is just POORLY written and POORLY tested software!

  • Hi ,How can I get a list of all laptops or users with folder direction enabled or offline files enabled, be it sccm or poerwshell . i have struggled for a week.

    Hi ,how can I get a list of all laptops or users with folder direction enabled or offline files enabled, be it sccm
    or poerwshell . i have struggled for a week
    tchocr

    Hi,
    There is no such PowerShell command can achiev this. Maybe you can use a script to get the user name with folder redirection enabled. However, I am not familiar with writing script, and it would be better for you to ask in script forum below for professional
    assistance:
    http://social.technet.microsoft.com/Forums/en-US/home?forum=ITCG&filter=alltypes&sort=lastpostdesc
    Best Regards,
    Mandy
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact [email protected]

  • How can I get a list of all workbooks

    Can anybody please tell me how can I get a list of all my workbooks that are on my Oracle Discoverer database without having to manually write them down? I am using Oracle Database 10g Enterprise Edition.

    Hi,
    To implement the EUL Management BA follow metalink NOTE:556932.1
    there are very simple steps you need to perform in order to use it

  • How can I get a list of all my annotations to send to someone else, listed by PAGE #, not order.

    How can I get a list of all my annotations to send to someone else, listed by PAGE #, not order??

    The comments list is sorted by page by default. If it's not for some reason, click the "Sort comments" button and select that option. It looks like this:

  • How can I get a list of all laptops or users with folder direction enabled or offline files enabled, be it sccm or poerwshell . i have struggled for a week.

    How can I get a list of all laptops or users with folder direction enabled or offline files enabled, be it sccm or poerwshell . i have struggled for a week.

    Hi,
    There is no such PowerShell command can achiev this. Maybe you can use a script to get the user name with folder redirection enabled. However, I am not familiar with writing script, and it would be better for you to ask in script forum below for professional
    assistance:
    http://social.technet.microsoft.com/Forums/en-US/home?forum=ITCG&filter=alltypes&sort=lastpostdesc
    Best Regards,
    Mandy
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact [email protected]

  • How can I get a display of all running programs in lion like I used to get when I did a 4 finger swipe in snow leopard?

    how can I get a display of all running programs in lion like I used to get when I did a 4 finger swipe in snow leopard?
    I liked to turn off running programs without a window that I was no longer using
    thanks.
    Best I can do now is to open the "force quit" window and click on programs I want to stop and then send each one a "command-Q" and then repeat as necessary
    Jeff

    Command + Tab is what you are after i think

  • I downloaded garage band on my iPad ages ago but now it just says waiting and when I click on it it just says "retry" and does nothing. I've spent literally ages making songs (I've got like 20 ). How can I get it back with all my songs still there?

    I downloaded garage band on my iPad ages ago but now it just says waiting and when I click on it it just says "retry" and does nothing. I've spent literally ages making songs (I've got like 20 ). How can I get it back with all my songs still there?

    Thanks for that. Much more constructive than the last comment. It's only the restriction code I can't recall, not the access passcode. So I can currently access the device, just not age restricted content. Does that's make a difference? I also wondered if anyone knew how many attempts you get to try to get it right. Now tried 21 times and so far nothing bad has happened but I am concerned I'll eventually be completely locked out of the device. That doesn't seem in the spirit of things though. Surely it's foreseeable that a child could repeatedly try to guess the code so I can't see that it would be right to lock the device down completely in that circumstance, particularly if the access code is being typed in correctly every time.
    Thanks

  • How can i get font sizes my eyesare bad ?

    how can i get font sizes my eyes are bad ?

    You need to update to Firefox 9.0.1. - http://www.mozilla.com/en-US/firefox/
    The Firefox [https://support.mozilla.com/en-US/kb/Page+Zoom Page Zoom] feature does a domain by domain level of saving the users preferred zoom level settings, there is no default Page Zoom level setting in Firefox, as with some other browsers.
    Try the Default FullZoom Level extension and set a default zoom level: <br />
    https://addons.mozilla.org/en-US/firefox/addon/6965
    Or the NoSquint extension: <br />
    https://addons.mozilla.org/en-US/firefox/addon/2592/

  • My tiles on Mahjong game have quadrupled in size. How can I get original size back?

    My tiles in Mahjong game have quadrupled in size. How can I get original size back. thanking you in advance. Earl66.

    Earl, welcome to the forum.
    It sounds like the resolution changes when you start the game.  You should check the video settings.  I checked the Mahjong game (Win 8.1) on my computer and there is no way to set the resolution in the Options.
    Please click the "Thumbs up + button" if I have helped you and click "Accept as Solution" if your problem is solved.
    Signature:
    HP TouchPad - 1.2 GHz; 1 GB memory; 32 GB storage; WebOS/CyanogenMod 11(Kit Kat)
    HP 10 Plus; Android-Kit Kat; 1.0 GHz Allwinner A31 ARM Cortex A7 Quad Core Processor ; 2GB RAM Memory Long: 2 GB DDR3L SDRAM (1600MHz); 16GB disable eMMC 16GB v4.51
    HP Omen; i7-4710QH; 8 GB memory; 256 GB San Disk SSD; Win 8.1
    HP Photosmart 7520 AIO
    ++++++++++++++++++
    **Click the Thumbs Up+ to say 'Thanks' and the 'Accept as Solution' if I have solved your problem.**
    Intelligence is God given; Wisdom is the sum of our mistakes!
    I am not an HP employee.

Maybe you are looking for