Still..Fetching Problem..Please Help

Hello! Below is the code snippets of my program to test the setFetchSize() method. When run, it still retrieves all the contents of the table. I just need to retrieve say 4 items per page. Please help. Thanks.
int skucd = 0;
String skudesc = "";
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con = DriverManager.getConnection("jdbc:odbc:dsShopCart", "", "");
Statement stmt = con.createStatement();
stmt.setFetchSize(4);
ResultSet rs = stmt.executeQuery("SELECT * FROM tblProduce");
while (rs.next())
skucd = rs.getInt("sku_code");
skudesc = rs.getString("sku_desc");
System.out.println("Sku Code-"+skucd +"/Desc-"+skudesc);

Using Stqtement.setFetchSize() one can only provide the JDBC driver a hint as to how many records the driver code should actually fetch from the database whenever it has reason to fetch results physically from the database and the driver is free to ignore that hint as well.
However, the point to be noted in your case is that when a JDBC driver actually fetches results from the database depends on the specific driver implementation. For example, this may happen not only when one invokes Statement.executeQuery() etc but later on, for example when one invokes some method that performs some row operation on the result set. So, using setFetchSize() one can provide a hint to the driver as to how many records to physically fetch from the database whenever there is such a need to physically fetch from the databse.
As far as I know, one has to implement some kind of paging model over the results by onseself.
If you are involved with diaplaying results on an HTML page, tis might help http://jsptags.com/tags/navigation/pager

Similar Messages

  • Disabled buttons still selectable problem, please help

    I have a simple GUI which takes input from the user and when it has enough information allows the user to select to run an operation (setEnabled(true) on the run button). Initially I set the run button on the GUI to be disabled using setEnabled(false). Although the button appears greyed out the mouse_clicked() event is run when you click on the button.
    Can anyone inform me what is wrong, it appears the button is disabled to look at but is still active if clicked.
    Regards,
    Mark

    Thanks, that did the trick. Thought it must be the type of Listener used as I have used setEnabled in the past without problems.

  • HT1926 i've tried so many times but the problem still exists! please help!!

    i've tried so many times but the problem still exists! please help!!

    Could you describe what your problem is, please?

  • Hi! I use MBP mid 2010. as per apple. I run mountain lion. Everytime I watch a videoclip on youtube, it just freezes or mostly just turns off and restarts. I tried erasing disk twice but still same problem. Help please?

    Hi! I use MBP mid 2010. I upgraded my ram to 8gb 1066 mhz as per apple. I run mountain lion. Everytime I watch a videoclip on youtube, it just freezes or mostly just turns off and restarts. I tried erasing disk twice but still same problem. Help please?

    Hi! I use MBP mid 2010. I upgraded my ram to 8gb 1066 mhz as per apple. I run mountain lion. Everytime I watch a videoclip on youtube, it just freezes or mostly just turns off and restarts. I tried erasing disk twice but still same problem. Help please?

  • When I try to log on to icloud it says "Apple ID is valid but not an icloud account? Changed my Apple password a few times reset my system still no luck Please help!t

    When I try to log on to icloud it says "Apple ID is valid but not an icloud account? Changed my Apple password a few times reset my system still no luck Please help!t

    Welcome to the Apple community.
    These types of messages often indicate a problem with the devices serial number, have you had your phone repaired at any stage or did you buy it second-hand.

  • My iPod touch is permanently disabled and it says to connect my iPod to my iTunes yet when I do that, it tells me to type in pass code even though it's still disabled. PLEASE HELP ME

    My iPod touch is permanently disabled and it says to connect my iPod to my iTunes yet when I do that, it tells me to type in pass code even though it's still disabled. PLEASE HELP ME

    I have the same problem with mine... but im trying to find a way to fix it without restoring it...
    but one fix is to shut it down completely ... then press and hold BOTH the power button and the home button .. hold both of those 4 ten seconds .. then release the power button but still hold down the home button .. and then it'll show something that says "connect to itunes" once u get it connected to itunes , click the restore button ... BEWARE THIS WILL WIPE OUT EVERYTHING ON YOUR IPOD!!! IT WILL RESTORE IT BACK TO FACTORY SETTINGS , AS IF U JUST BOUGHT IT !!!!! then it should work fine again .. but u will lose all data on there besides the things you have synced with itunes already..
    Thats y im iffy with doing this , im trying to find a fix where i wont have 2 restore it but i dont think there is 1 :'(
    good luck tho
    ~sam

  • [TV@Master] Problem please help

    I have Msi.mother board PT8-Neo -LSR ,  Model No.Ms-6799 , main board bios -Phonenix ,maind board version i updat it to 2.2 , cpu size 2.4 G celleron D/256/533 , memory size 256DDram (400),display card Nvidia Riva TNT2 model 64
    the problem that i face it when i put my TV@nywhere -master card ,the pc stop at the main page that show the biso version and name of bios company and the letters do not bost well it look like a virus work , and when i take tha card off the pc go normally , i tried put it to other PCI the same problem
    please help

    i meany by fix the problem of getting the pc go on to windows with card on PCI salot but i still have the broblem of the driver
    please read my reply again
    my operating system is win me and i have also another pc have XP
    when i log in to windows the system show that found my TV@nywhere card but it didnt took the installatin driver for it i tried to install the driver directly
    but it give me this 2 mesages  when i try to install the driver
    MSI TV card is not found ,stop the installation
    the other message is
    MSI pvs driver installatin failed
    i download the driver from msi page also give me the same messages
    for known on Device Manager it show me that the driver there but do not have the driver and the ? mark beside them
    what to do now 

  • Update to the new release and firefox hangs and becomes unresponsive each time I try to open it. I have tried removing firefox from my pc, restarted my pc. went to Google Chrome and downloaded it again. Still hanging. Please help

    Update to the new release and firefox hangs and becomes unresponsive each time I try to open it. I have tried removing firefox from my pc, restarted my pc. went to Google Chrome and downloaded it again. Still hanging. Please help
    I can open Google Chrome and IE without any problems. My new version of Thunderbird won't let me see messages.

    So i have just unistalled itunes logged on to apple to try and download the itunes prog ,but it dont seem to have downloaded.can anyone help me please.
    Could you walk us through what happened when you tried to do the download, please?

  • Hello!i have problem to insttal potoshop cs6 this is,we've encountered the following issues.installer failed to initialize.this could be due to a missing file.please download adobe support advisor to detected the problem.please,help me

    this is,we've encountered the following issues.
    installer failed to initialize.this could be due to a missing file.please download adobe support advisor to detected the problem.
    please,help me!

    Hi there Mylenium, is there any way you can help me? My cs6 is doing all kinds weird things lately. The liquifying too stopped working completely, when I try to work with the actions, it starts flickering and changing opacity in color by itself. It starts flickering and is completely out of whack! I tried uninstalling and reinstalling and still no luck. I tried getting in touch with adobe and no luck with that neither! Is there anyway you might be able to help?

  • After trying to send a 15,000 character text my app froze and it crashes every time. I hard closed it, restarted my phone, but still nothing. Please help. I have an iPhone 4S running iOS 6.

    My messaging app is frozen and I can't text after I tried to spam my friend with a 15,000 character text. I hard closed the app and restarted my phone but still nothing. Please help.

    I had the VERY same problem with a iPhone 6 Plus running iOS 8.0.2. I did a hard reset and a full restore to factory settings and then a restore from a back up- nothing worked. I then read Cal4one's post on turning off the read text function (which I had just turned on days before to try out) and ta-da! all is well! I can now use Messages and when I go to attach a picture, the Photo library comes up quickly (it was not before the chance) and the Message app no longer crashes. Just to be safe, I turned off all reading functions in the Accessibility (settings/general/accessibility/speech) settings.

  • X-Fi Fatal1ty Plat1num Champion Ed. problem, please help!

    9X-Fi Fatalty Platnum Champion Ed. problem, please help!? Hi there everyone,
    So i have a X-Fi Fatalty Platnum Champion Ed. and a computer with Windows 7.
    I've searched the web and i found many people saying that the card it's working and perfectly compatible so i would like to exclude this option as far as the problems that i'm having.
    So, right out of the box i've placed the front panel in with the ribbon cable and the power connected to it, then i connected the other end of the ribbon cable and finally placed the card in one of the PCI slots i have free.
    Now, when i start my PC, i don't hear any particolar "beep messages" but nothing will come on the screen, in few words my PC will not boot at all. I can hear the HDD spinning, everything sounds normal except for that "little" problem.
    So, i re-did all the connections thinking that maybe i did something wrong, but following the instruction i did exactly as told. So i tried again to power up the computer and i've noticed that the X-Fi logo is lit up (red light) and.. I don't really know if that means something or it's just something aside that doesn't really matter.. But, what is it's The PCI card is broken or there's something else?
    I did try to disable the sound card (integrated mobo sound) from the BIOS but that didn't change anything. I did try all the software options but this looks like more of an hardware problem (please correct me if i'm wrong and/or i've missed something).
    There's something that popped up in my mind.. the PSU. I noticed that i have a 300W PSU (mm.. low, isn't it's)?and i was wondering if that's enough or i need a more powerful one.. and if that's may be the case for the PCI to not work at all causing all i've already explained above. I mean.. It seems like i've installed a dead peripheral and that's impeding the computer to start up..
    I don't know.. I need clarification and help, PLEASE.
    Thank you very much in advance!

    Look at the beta thread sticked above but good luck waiting for a new driver. That beta driver has been there since January and although better than the normal driver it is still crap.
    All the boot type issues are with the SSD but if you getting in game crashes etc... under windows 8 that is simply that the driver stinks.

  • Hello sir my iphone screen turns off after using 2-5 minutes what would be the problem please help me out

    hello sir my iphone screen turns off after using 2-5 minutes what would be the problem please help me out

    To make sure that this is not software related, set it back to factory settings, without using any backup data afterwards. Set up the rest of the personal settings manually and test the phone. If it still does not work, this is a hardware issue and the phone has to be serviced by Apple or an Authorized Apple Service Provider:
    Use iTunes to restore your iOS device to factory settings - Apple Support
    Find an Apple Authorized Service Provider
    iPhone - Contact Support - Apple Support

  • Hi .. my iPad 4 with iso 7.0.3 he is restarting himself ... How can i solve this problem please help me

    Hi .. my iPad 4 with iso 7.0.3 he is restarting himself ... How can i solve this problem please help me

    Standard troubleshooting...
    1. Try a Restart by pressing the sleep/lock button until you see the slider.  Slide to power off.  Restart by pressing the sleep/lock button until you see the Apple logo.
    2. Try a Reset by pressing the home and sleep buttons until you see the Apple logo. Takes about 5-15 secs of button holding and you won't lose any data or settings.
    3. Remove apps from Recently Used list...
    - From any Home Screen, double tap the home button to bring up the Recents List
    - Swipe up on the app preview card to remove it from the list
    - Press the home button when done.
    4. If still a problem restore with your backup.
    5. If still a problem restore as new, i.e. without your backup. See how it runs with nothing synced to it.
    6. If still a problem, it's likely a hardware issue.

  • My iphone 5 32 gb has an camera autofocus problem, please help me solve this

    my iphone 5 32 gb has an camera autofocus problem, please help me solve this

    Hi teejayfs,
    Thanks for visiting Apple Support Communities.
    If you've noticed unexpected behavior with your iPhone camera, start with these steps to isolate or resolve the issue:
    Camera isn't functioning or has undesired image quality
    If the screen shows a closed lens or black image, force quit the Camera app.
    If you do not see the Camera app on the Home screen, try searching for it in Spotlight. If the camera does not show up in the search, check to make sure that Restrictions are not turned on by tappingSettings > General > Restrictions.
    Ensure the camera lens is clean and free from any obstructions. Use a microfiber polishing cloth to clean the lens.
    Cases can interfere with the camera and the flash. Try gently cleaning the lens with a clean dry cloth or removing the case if you see image or color-quality issues with photos.
    Try turning iPhone off and then back on.
    Tap to focus the camera on the subject. The image may pulse or briefly go in and out of focus as it adjusts.
    Try to remain steady while focusing:
    Still images: Remain steady while taking the picture. If you move too far in any direction, the camera automatically refocuses to the center.
    Note: If you take a picture with iPhone turned sideways, it is automatically saved in landscape orientation.
    Video: Adjust focus before you begin recording. You can also tap to readjust focus while recording. Exiting the Camera application while recording will stop recording and will save the video to the Camera Roll.
    Note: Video-recording features are not available on original iPhone or iPhone 3G.
    If your iPhone has a front and rear camera, try switching between them to verify if the issue persists on both.
    You can find these steps here:
    iPhone: Hardware troubleshooting
    http://support.apple.com/kb/TS2802
    Regards,
    Jeremy

  • Urgent Problem please Help(hayat)

    Hello Hi,
    I want to Install Form 6.0 With Oracle 8i on Server
    mean not personal oracle,
    if i install first oracle 8i and then form 6.0 then
    they overwrite their homes and vice versa.
    What method i use to control this problem.
    please help me so that i install form 6.0 on oracle 8i server.
    thanks
    hayat

    Ok, I have read the sun site and downloaded the JDK and saved it to disk in the C:\ drive.
    However I still get the same error so I think I must be very stupid and I think the computer knows that.

  • TS2755 in the usage part of my phone it says 1.9Gb of memory is taking up by messages, i have deleted most of my messages and still no luck, please help?:((

    in the usage part of my phone it says 1.9Gb of memory is taking up by messages, i have deleted most of my messages and still no luck, please help?:((

    I found a post with this solution that worked for me - .Do a backup, then download ibackupbot. It lets you look into the contents of that backup. Look in system files>mediadomain>library>sms>attachments. I found a ton of huge files related to long deleted texts. ibackupbot let me delete all that old crap. I then restored the phone with that now modifec backup and Bingo! freed up 9 GB. No problems.
    But note, if you are not technically inclined you probaly don't want to be digging around and deleting back up files. You delete the wrong thing and you could jack up your phone badly. Be careful.

Maybe you are looking for

  • How to include the page dynamically in JSF

    Hi all Below is static include <jsp:include page="../inc/sideMenu.inc"/> How to include the file dynamically Thanks

  • IPhoto crash on import (not 3ivx?)

    Hello!. I've browsed through the boards for this question and come upon many similar answers. I could be mistaken, but I don' t think what's been posted is working for me. I am running Lion 10.7.4 and iPhoto 8.1.2. I'm having an issue importing certa

  • Jumeler un mac avec projecteur optima

    J'ai acheté un projecteur usager Optima, MODEL EP719, no de série O82G544AAAAAC1360, compatible avec Mac selon les informations du CD d'installation. Je suis incapable d'installer le software. J'utilise un Macbook Pro OS X version 10.9.4. Le software

  • Selection in JList

    Hi! I am using JScrollbar to hold the JList and i have set the property setVisibleRowCount to 1. List contains the values from 0..1000, if i want the default value to be displayed in the JList is 21, i have set the ensureIndexVisible property to 21,

  • Is there a way to upgrade from leopard to lion without buying snow leopard? Will there be a DVD or a bundle for that case?

    I know you have to have snow leopard to download lion via app store. But isn't there a possibilty to buy a bundle or any other way of upgrading without paying double price? So far I can't find any information on the Apple website except you have to h