Printing with 1 additional column every time resultSet  is given

I have a resultSet that will return an extra column everytime around. I want to my Printing loop(code below) to be able to print an extra column everytime the resultSet is brought back with new data. How can this be done?
do{     
               String column1 = rs.getString(1);
               String column2 = rs.getString(2);
          System.out.println (column1 + column2);
}while (rs.next());

It's weird that the number of columns would grow each time you run it. It sounds like you have an oddly-arranged schema.
Anyway, what you want is the java.sql.ResultSetMetaData. Read the API docs about it. It'll tell you how many columns there are, what types they are, etc., so you can then change what you read from the results. You'll probably end up with a new nested loop inside the existing one, rather than hardcoding as you have now.

Similar Messages

  • How to turn off printing message box that appears every time I send a document to the printer?

    How to turn off printing message box that appears every time I send a document to the printer?  Appears bottom right corner of screen above task bar.  Printer is HP c309a All-in-One PhotoSmart printer.

    I have an Iphone 4s, and every time I receive a call and i dont answer it, the cell shows a black screen with many things to do and automatic messages to send, like "call back, save, remind, call now, call later, etc". If I don´t close it as soon as i receive the call, then the cell gets frozen in that screen and i have to restart it. Sory for my english, i´m from argentina! thaks for your help !!!

  • Hello Apple? How do i fixed my problem with my ipad apps every time i open that apps it takes 10min. to play the games ant its getting LOST MODE and the ipad system is crashing

    How do i fixed my problem with my ipad apps every time i open that apps it takes 10min. to play the games ant its getting LOST MODE and the ipad system is crashing

    We are fellow users here on these user-to-user forums, you're not talking to iTunes Support nor Apple.
    Have you tried closing all apps via the iPad's multitasking bar and then doing a soft-reset and seeing that helps ? To close all apps :
    iOS 7: double-click the home button to open the taskbar, and then swipe or drag each app's screen from there up and off the top of the screen to close it, and click the home button to close the taskbar.
    iOS 6 and below : from the home screen (i.e. not with any app 'open' on-screen) double-click the home button to bring up the taskbar, then press and hold any of the apps on the taskbar for a couple of seconds or so until they start shaking, then press the '-' in the top left of each app to close it, and touch any part of the screen above the taskbar so as to stop the shaking and close the taskbar.
    Soft-reset : press and hold both the sleep and home buttons for about 10 to 15 seconds (ignore the red slider), after which the Apple logo should appear - you won't lose any content, it's the iPad equivalent of a reboot.

  • Why does my itunes crash after start up with an "APPCRASH" error every time i open it?! I have been trying to fix this for weeks but all i can do it re-install it every other day which does nothing!

    Why does my itunes crash after start up with an "APPCRASH" error every time i open it?! I have been trying to fix this for weeks but all i can do it re-install it every other day which does nothing! I am desperate to get access to my itunes to get music on my phone and all of this just makes me want me to sell my iphone since there is no other way to add music to my phone. If things go get sorted soon you can say goodbye to my support.

    For general advice see Troubleshooting issues with iTunes for Windows updates.
    The steps in the second box are a guide to removing everything related to iTunes and then rebuilding it which is often a good starting point unless the symptoms indicate a more specific approach. Review the other boxes and the list of support documents further down the page in case one of them applies.
    The further information area has direct links to the current and recent builds in case you have problems downloading, need to revert to an older version or want to try the iTunes for Windows (64-bit - for older video cards) release as a workaround for installation or performance issues, or compatibility with QuickTime or third party software.
    Your library should be unaffected by these steps but there are also links to backup and recovery advice should it be needed.
    tt2

  • My macbook is stuck on a grey screen with language select and every time i click english it brings me back to the same gray page what do i do?

    My macbook Pro is stuck on a grey screen with language select and every time i click english it brings me back to the same gray page with language select what do i do? Also i dont have enough monet to go to the apple store to get it fix and another thing this happen after i tried to factory reset it without the disck uising coomans i found on youtube.Lastly befor doing the comands my macbook would open any applications and the finder would just blink on and off on the dock.
    Heres the link http://www.youtube.com/watch?v=Q5e5thk0O9o

    Shut down your computer and disconnect all peripherals (keyboard & mouse if pertinent) from your computer.  Now reboot.
    If the Mac starts up normally, shut it down again and then plug in one of the peripherals (keyboard or mouse first) and start up your computer again.  If it does so successfully repeat the process, adding one peripheral at a time until your Mac acts up.  At that point, disconnect the last peripheral you added, reboot your Mac and search the peripheral vendor's website for an updated driver. 
    If no driver exists or the problem remain after installing the new driver, try a different cable or a different port on your Mac.
    If none of the above works, again disconnect all peripherals from your Mac, hold down the "shift" key to start up in "Safe Boot" mode. 
    If the Mac starts up correctly, restart without pressing the "shift" key.
    If your computer still does not start up properly, shut it down and restart it while holding down the Apple+Option-P-R keys; keep holding "all 4 keys" down until you hear the startup sound "twice."
    If none of the above work Disconnect all peripherals from your computer. Boot from your install disc & run Repair Disk from the utility menu. To use the Install Mac OS X disc, insert the disc, and restart your computer while holding down the C key as it starts up.
    Select your language.
    Once on the desktop, select Utility in the menu bar.
    Select Disk Utility.
    Select the disk or volume in the list of disks and volumes, and then click First Aid.
    Click Repair Disk.
    (If Disk Utility cannot repair, you will need a stronger utility (3rd party) - Diskwarrior or Techtool PRO)
    Restart your computer when done.
    Repair permissions after you reach the desktop-http://docs.info.apple.com/article.html?artnum=25751 and restart your computer.
    Remove any 3rd party ram.
    Reinstall Leopard - This will install a "fresh" copy Leopard without archiving old system files but leaves the rest of your files in place.
    If you still want to restore your computer to factory level...
    Start up from your install disc, go to Disk Utility and select the disk and click erase - to securely erase data click Security Options and Erase Free Space which will entirely wipe your disk, overwriting it with zeros so that no data is recoverable.
    To restore read the instructions in the Mac OS X v10.5 Leopard - Installation and Setup Guide  PDF

  • I installed Mavericks yesterday and have now got problems with QuarkXpress 9. Every time I click on an image and try to move it the application crashes. Anyone had similar problems or got any suggestions?

    I installed Mavericks yesterday and have now got problems with QuarkXpress 9. Every time I click on an image and try to move it the application crashes. Anyone had similar problems or got any suggestions?

    Hi Guys
    Updated my 2 imacs to Maverick yesterday. Schoolboy error on my part not checking if there were problems with any programmes before I did.
    Quark is now a nightmare with no short term answer on the way. As a Quark user for over 20 years this is just another reason to hold your hands up and say OK Indesign you win I will have to learn how to use you and Quark will be a distant memory.
    I am told there will probably be no solution to getting quak 9 running on Maverick and that you will need to update to 10 in about 2-3 weeks to get back to normal. Having spent a few bob on 2 versions of 9.5 only in Feb this year i didn't really want to upgrade yet.
    So its cough up to carry on using Quark or learn Indesign.
    I have lost faith in Quark as they are quick to send me e-mails asking me to upgrade to this and that version, why didn't they send one out saying do not upgrade to Maverick. Perhaps they know there loyal follwing will uograde to 10 and will generate a nice little bonus before Xmas.
    Lots to do today and will now take 10 times longer to do it. Is this 2013 or 1974!!!!!
    If anyone hears of a solution please post ASAP

  • I am trying to update my iPad 3 with iOS 6. Every time I do, it updates for about 20 minutes, then says an error ocurrs. Please help

    I am trying to update my iPad 3 with iOS 6. Every time I do, it updates for about 20 minutes, then says an error ocurrs. Please help

    Classic. Make sure that you've got the latest version of iTunes.
    Good luck!

  • I'm trying to play this new movie i bought with my macbook but every time i put the movie in it makes a noise and only stays there for 6 seconds then ejects itself how can i fix this problem?

    I'm trying to play this new movie i bought with my macbook but every time i put the movie in it makes a noise and only stays there for 6 seconds then ejects itself how can i fix this problem?

    Restart your phone,hold the home button and the off button down till the apple symbol comes up. If that doesnt fix it , you need to do a restore in itunes by connecting to itunes , click on your phones name to the left, then click restore in the center of the screen and restore from backup.

  • Hi. I have got problem with my ITunes. Every time I´m opening the program I´ve got the message: One unkwown problem is appering (-42032) Can anybode please tell me what to do wit this error? Thanks

    Hi. I have got problem with my ITunes. Every time I´m opening the program I´ve got the message: One unkwown problem is appering (-42032) Can anybode please tell me what to do wit this error? Thanks

    Gary,
    discussions may sometimes be slow for an hour or so (at which point the opening page of discussions will eventually apologize for the inconvenience, back on line soon...) but your description looks like a cache problem.
    Try OnyX freeware to do some cleanup and see if that helps.
    http://www.titanium.free.fr/index.html

  • I-tunes not kompatibel with Windows 8. Every time I want to load my Ipod or Iphone I have to change the compability to, for instance windows vista. Otherwise Itunes refuse to recognize my Ipad/phone. Can I expect that Itunes will "fix" this problem? Carin

    I have problems with I-tunes and the compability with windows 8. Every time I whant to load my Ipod/Iphone Itunes doesn´t recognize the pod/phone. If I change the compability to for instance windows vista it works ok.
    I guess that I need some update of Itunes?
    carin

    Hey carin205,
    I would run through the troubleshooting steps in the following article:
    iOS: Device not recognized in iTunes for Windows
    http://support.apple.com/kb/TS1538
    Welcome to Apple Support Communities!
    Regards,
    Delgadoh

  • I share my calendar with my wife.  Every time I enter a new appointment, she receives an email alerting her to it.  She has asked me to turn this off as it just fills up her email inbox with my "spam."  Any help doing this would be appreciated.  Thanks

    I share my calendar with my wife.  Every time I create a new event, it alerts her to it by send her an email.  She thinks this is just my "spam" and wants me to turn it off.  I can't figure out how to do this.  Can someone give me the answer?  Thanks

    I think (and I'll double check) only the BBLink events will sync on a wired USB sync. I'm fairly certain of that.
    You'll need to use your calendar syncing via an EAS email account (outlook.com, for instance, is free) to sync wirelessly. It works great. I use it and was a former tied to the USB sync guy as well... and I thought I was gonna die a painful death without it. I found more freedom this way.
    This explains the process. But I don't think you'll get BBM Groups to sync.
    http://supportforums.blackberry.com/t5/BlackBerry-​Z10/How-To-OTA-Sync-BB10-and-non-BES-Outlook-Overv​...
    1. If any post helps you please click the below the post(s) that helped you.
    2. Please resolve your thread by marking the post "Solution?" which solved it for you!
    3. Install free BlackBerry Protect today for backups of contacts and data.
    4. Guide to Unlocking your BlackBerry & Unlock Codes
    Join our BBM Channels (Beta)
    BlackBerry Support Forums Channel
    PIN: C0001B7B4   Display/Scan Bar Code
    Knowledge Base Updates
    PIN: C0005A9AA   Display/Scan Bar Code

  • Sign in with username and password every time I want to check emails on my PC using iCloud?

    Signing in with username and password every time I want to check emails on my PC using iCloud
    Having convinced my parents to get rid of their old AOL account and sign up for iCloud to sync their new iPhone with their old PC running Windows 7, I thought I was on to a winner. All working OK but is there any other way to get into emails besides going on iCloud website and signing in with name and password everytime? Can it be set up as a Mail account directly like on a Mac? Or using Outlook or Entourage? Help! I'm not a PC person!!
    ELF

    If they have Win 7 or 8, and Outlook 2007 or newer then you can.
    Just download the iCloud Control Panel for Windows. Install and select the services you want (Mail Contacts and Calendars will appear in Outlook)

  • Every time I navigate to a new site or page I also get additional new tabs opening which say 'Microsoft Exchange Server 2007 - this page is no longer available', so I soon end up with an extra tab every time I navigate to a new page.

    so I am geting an additional unwanted MS Exchange tab/window every time I navigate to a new site or bookmark. i recentlly upgraded to Firefox 5.0 and I think this problem may have started around the same time. I also have MS Outlook but this is stand alone and I do not synch online at all, and have not changed any settings in it.

    Try the Firefox SafeMode. <br />
    ''A troubleshooting mode, which disables most Add-ons.'' <br />
    ''(If you're not using it, switch to the Default Theme.)''
    # You can open the Firefox 4/5/6/7 SafeMode by holding the '''Shft''' key when you use the Firefox desktop or Start menu shortcut.
    # Or use the Help menu item, click on '''Restart with Add-ons Disabled...''' while Firefox is running. <br />
    ''To exit the Firefox Safe Mode, just close Firefox and wait a few seconds before using the Firefox shortcut (without the Shft key) to open it again.''
    If it is good in the Firefox SafeMode, your problem is probably caused by an extension, and you need to figure out which one. <br />
    http://support.mozilla.com/en-US/kb/troubleshooting+extensions+and+themes

  • My macbook is loaded with microsoft work and every time I try and open the program I get an error reading and it will not open.  Powerpoint and the other applications still respond!

    my macbook is loaded with microsoft word for macs and every time I try and open the program I get an error reading and it will not open. This is what it says:
    The application Microsof Word quit eunexpectedly.  Powerpoint and the other applications still respond!

    The joys of Microsoft!
    Maybe the preferences file is corrupted.  You should be able to find the Word preferences file in the folder:
    your user name/Library/Preferences
    Its name is com.microsoft.Word.plist
    I suggest you drag this another folder and try Word again. 
    If that doesn't work then you might find clearing the cache files will fix the problem.  You can do this manually but I never bother. Instead I use a program like Snow Leopard Cache Cleaner (shareware) or Onyx (free). These programs do lots of other maintenance jobs so it's worth having at least one of them.
    Bob

  • Beige G3 with Pro Tools Freezes Every Time I Use PT (why I have the G3)

    Please, if anyone can help....
    I GOT my beige G3 running which had died and refused to reboot when last I had tried running Pro Tools. I GOT Pro Tools 6.1 reinstalled and running... and then when I was back in Pro Tools again on my newly-running system, I tried to "Save Session Copy" (including saving audio files), it froze. It seems whenever I ask Pro Tools (specifically, haven't had this problem with ANY other memory-intensive program) to do something even mildly memory-intensive, it freezes. Not just the program freezes, the whole computer does. And once again, the computer then refused to reboot. I tried running First Aid and Repair Permissions and so forth booting from the OS X.2 CD. No dice. I erased the 7.8 gig section (the bootable section) of the hard drive. Tried to re-install the OS. It freezes mid-install every time now. Didn't used to freeze (though always bogged down a bit from time to time). Then I tried erasing the WHOLE 120 gig disk (while weeping bitterly) and re-partitioning the 3 sections (as a Mac-person-who-knows-more-than-me instructed me to do- - was the only thing that worked- - the first section being 7.8 gigs) and reinstalling the OS. Still freezes when I try to install. I have to move the mouse around frantically just to keep the computer from freezing while erasing the drive (this actually works- - moving the mouse around).
    I tried putting the 3 sticks of ram in different order- - they worked fine before- -the 3 sticks of RAM collectively add up to 600-something- 1 stick of 128 and 2 of 256 or whatever that amount is- - the 2 were originally bought for a "stripped" blue and white I had bought, but the blue and white makes heinous buzz-beeping sounds when I tried to run it most recently, though it worked for a while before. Also, the beige worked fine before with these same sticks of RAM installed, but this seemed maybe memory-related so I thought I'd experiment...?
    Anyway, I have A LOT of extras plugged into this thing. The one that acts the most buggy is the TDK DVD-R drive I installed a couple years ago. The model is "Indi" something or other as I recall. It has always consistently done this weird thing where, after booting the computer, if you eject one disk (it will only eject if you drag to the trash) and insert a second disk (since booting), it will not allow you to eject the 2nd disk until you reboot again. If you drag that 2nd disk to the trash, the CD icon disappears from the desktop as though it's been ejected, but the drive does not physically eject. I just put up with it, because I could deal and there had been so many other issues, and everything was working, this seemed like a non-issue by comparison.
    I am also running a PC monitor via a small adapter (not a card). I have a USB PCI card going (which the mouse is plugged into)- never had a problem, but now sometimes the mouse freezes on startup too and won't move and I have to force-power-down with that button on the front as if it didn't boot properly. I have an Audio Media III PCI card in there (for Pro Tools). I have the monitor card in there, but don't need it for this machine. Was trying to test if it worked-- last I tested, it didn't-- I should obviously just pull it out.
    Anyway, I'm having a ** of a time getting the OS back on there, and even if I do, once I put Pro Tools back on (the point of doing all of this and using the machine at all), it will likely freeze again and I'll be right back where I am right now. If I can even get there in the first place.
    Please please please help...
    Blue and White G3   Mac OS X (10.2.x)  

    Conventional wisdom for installing 10.2 Jaguar is to strip the machine back to the minimum Apple might have shipped in it, Install the OS, then add your extras back in.
    Memory seems to be a big issue -- I suggest you use the free DIMM First Aid under Mac OS 9 to scan your DIMMs and be sure they are OK for your Mac, and not too slow:
    http://www.mactcp.org.nz/dimmfirstaid.html
    I have found 10.3 Panther much simpler and more pleasant to install (even if you had to use XPostFacto 3.1 to do it) than 10.2 Jaguar ever was.

Maybe you are looking for