How can i reduce round trips to my database

Hi All,
Please suggest me to reduce the roundtrips to DB. If any suggestions please post me. This topic only pending for my project. Kindly post ur valuable suggestions.
try
     Class.forName("org.gjt.mm.mysql.Driver");
                 con = DriverManager.getConnection("jdbc:mysql:///mysql","root","smartdrive");
     rs = stmt.executeQuery("select count(*) from breakdetails where loginstatus=1 and breakstatus !=0 and TL!= 'Default' and TL!='B. SHASHANK'");
     if(rs.next()) {RC=rs.getInt(1); Lt1=0; Lt2=1;}
     rs = stmt.executeQuery("select count(breaktype) from breakdetails where breaktype='Mini Break'");
     if(rs.next()) MnBRK = (Integer)rs.getInt(1);
     rs = stmt.executeQuery("select count(breaktype) from breakdetails ;
     if(rs.next()) ABRK = (Integer)rs.getInt(1);
     rs = stmt.executeQuery("select count(breaktype) from breakdetails where breaktype='Lunch Break'");
     if(rs.next()) LBRK = (Integer)rs.getInt(1);
     rs = stmt.executeQuery("select count(breaktype) from breakdetails where breaktype='Meeting'");
     if(rs.next()) MBRK = (Integer)rs.getInt(1);
     rs = stmt.executeQuery("select count(breaktype) from breakdetails where breaktype='Training'");
     if(rs.next()) TBRK = (Integer)rs.getInt(1);
     rs = stmt.executeQuery("select count(breaktype) from breakdetails where breaktype='Feed Back'");
     if(rs.next()) FBRK = (Integer)rs.getInt(1);
     rs = stmt.executeQuery("select count(breaktype) from breakdetails where breaktype='Personal'");
     if(rs.next()) PBRK = (Integer)rs.getInt(1);
     rs = stmt.executeQuery("select count(breaktype) from breakdetails where breaktype='No Work'");
     if(rs.next()) NWBRK = (Integer)rs.getInt(1);
     rs = stmt.executeQuery("select count(tl) from empdetails where accesslevel='tl'and loginstatus=1");
     if(rs.next())
     TLC = rs.getInt(1);
     rs = stmt.executeQuery("select count(empid) from empdetails where accesslevel='agent' and loginstatus=1");
     if(rs.next())
     AC = rs.getInt(1);
     rs = stmt.executeQuery("select count(empid) from empdetails where accesslevel='qa'and loginstatus=1");
     if(rs.next())
     QC = rs.getInt(1);
     rs = stmt.executeQuery("select count(distinct(tl)) from empdetails where accesslevel='agent'and loginstatus=1");
     if(rs.next())
     TMC = rs.getInt(1);     
          catch(Exception e)
            e.printStackTrace();
{code}
Thanks in advance.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

This is a sql question not a java one, you need to look at combining some of those statements.
Also I suggest you lookup what cyclomatic complexity is.

Similar Messages

  • I'm trying to sign in to icloud on my laptop to access my itunes but it says my apple id is valid but wont open.  I don't have an apple phone, I have an android phone.  How can i get round this?

    I am trying to access some of my songs on itunes on my pc but it's says I need to install icloud.  I did this but it says I need to sync my phone but that is an android phone.  It says my apple id is valid but still won't let me sign in.  How can I get round this?

    Enchanted1 wrote:
    All this and I still don't have enough space on my startup disk, but that's another whole question!
    No, this should be the number one thing you are concerned about.
    Until you get this sorted, there is a good chance you may simply lose everything.
    Do you hav ean external drive?
    If so copy the entire /Music/iTunes/ folder to the external drive.
    Then you can delete /Music/iTunes/ empty the trash and recover this space.
    Do this then Apple menu > Software update.
    Restart the computer
    Then post back.

  • How can I get round problem with itunes. I get message saying computer isnt authorised to play some tracks Ive downloaded, tells me to authorise which I do, then a message appears saying the computer is already authorised but I still cant access the track

    how can I get round the problem I have with itunes. I have bought and downloaded various tracks to my library. When I try to sync my iphone from my PC I get a message on screen saying that it is not authorised to play them and tells me to authorise the computer by clicking store, entering apple id and password then clicking authorise this computer. I do that then get a message saying that my computer is already authorised yet when I try syncing the track again the same thihng happens. Im getting nowhere!

    If only some of the songs on an album are giving you the authorisation message, that suggests those song files are damaged.
    If your country's iTunes Store allows you to redownload purchased tracks, I'd delete your current copies of the dodgy tracks and try redownloading fresh copies. For instructions, see the following document:
    Downloading past purchases from the App Store, iBookstore, and iTunes Store
    Otherwise, I'd report the problem to the iTunes Store.
    Log in to the Store. Click on "Account" in your Quick Links. When you're in your Account information screen, go down to Purchase History and click "See all".
    Find the items that are not playing properly. If you can't see "Report a Problem" next to the items, click the "Report a problem" button. Now click the "Report a Problem" links next to the items.

  • Hi guys , I have a problem , the place for my others is more than 2 G , how can I reduce it ?

    hi ,
    I have a problem with my iphone. I have a 8G and I have more others than any apps , audio , photos and whatevaer.I have about 2G of others on it.I deleted all my safari cache and data. How can I reduce it ?
    Thanks!!!

    This can indicate corrupt files.  A restore should resolve.

  • How can I reduce the brightness of my screen?

    I installed WIndows 7 on my MAC and after installing the boot camp drivers, the screen went really bright.
    I reduced the brightness to the lowest setting on my keyboard, but it is still bright.
    The problem is not so much on the graphics, its more on the brightness of the white background & black text.
    How can I reduce the brightness?

    ang188 wrote:
    I reduced the brightness to the lowest setting on my keyboard, but it is still bright.
    The problem is not so much on the graphics, its more on the brightness of the white background & black text.
    How can I reduce the brightness?
    Start menu > control panel > appearance & personalization > display > calibrate color
    I would adjust the keyboard setting back to midway before calibrating, this way you have some flexibility to use that again.

  • I have an imac 27 inch O SX 10.6.8. using iphoto 11 Version 9.1.5. I have scanned some photos at very high resolution with each photo being about 45MB. They're saved to desktop. How can I reduce the size of the scanned photo's they are crashing iphoto

    I have an imac 27 inch O SX 10.6.8. using iphoto 11 Version 9.1.5. I have scanned some photos at very high resolution with each photo being about 45MB. They're saved to desktop. How can I reduce the size of the scanned photo's they are crashing iphoto.

    What format are they? Tiif? Jpeg? You can compress them with a lot of apps - including Preivew and just about any graphics editor out there. I'm not sure that 45mb would crash iPhoto thogh, are yo sure that's the cause? I know that some folks have mentioned pixel dimensions causing issues, as can color profiles.
    Regards
    TD

  • Why is my word and pdf files so large? How can I reduce the size?

    My document contains mostly photos from a database via a path to the actual jpeg photos on disk.
    There are 39 jpeg photos + a small amount of text with each photo.
    The 39 jpeg photos on the disk add up to be 5.79 mb.
    If I export the crystal reports document as [Microsoft Word (97-2003) Non Editable] the, the file size is 36.8 mb.
    If I export the same data as a [Microsoft Word (97-2003) Editable] the file size is only 3.1 mb.
    That is a difference of 33.7 mb! Why?
    Also, when I export the same data to a PDF file it is much larger than I think it should be; 12.7 mb.
    Why is my word and PDF files so large?
    How can I reduce the size of the word and PDF files? (without reducing the photo quality).
    Are there any tools to post process the Word or PDF files to reduce the file size?

    You can't, extra size is to hold the details

  • How can I reduce size of a PDF file?

    My PDF file is 20MB.  How can I reduce its size?

    I used the"File > Save as Other > Reduced Size PDF" method and reduced a 4 MB pdf down to about 2.7 MB.
    I then just printed the same file out to the Print PDF (not sure of the exact name) print driver.  When you install Adobe Acrobat, it adds a virtual printer to your list of available printers.  When you print to it, you don't get an actual print out, you just get a new PDF file.  This method reduced the same 4 MB pdf down to about 1.5 MB.
    I find it weird that their Reduced Size PDF method gave inferior results.  Why don't they just have that function do whatever printing to the virtual printer does?

  • How can I reduce the bit rate of songs in my Music Library to enable me to

    At the moment i can only fit about 1300 songs on my iphone and also have used up half the space on my 120gb Classic with 7000 songs which is a lot less than what i was told would fit on. so............
    How can I reduce the bit rate of songs in my Music Library to enable me to fit more songs onto my iPhone or iPod Classic.. and what is the minimum rate that i should stick to in order to retain good sound quality.

    For existing tracks, see:
    http://support.apple.com/kb/HT1550
    For CDs you import in the future, change the Import settings in the iTunes -> General preferences.
    As to what will be a good bit rate, that's going to be up to you and what quality you find acceptable, but many people find that 128 kbps AAC is the optimum balance between small file size and quality.

  • How can I reduce the display width of Firefox: I have my monitor in portriat mode, and the right side of the screen does not display.

    How can I reduce the size of the Firefox monitor display?
    I use my monitor in portrait mode, and the right side of the Firefox window is not displayed.

    Try using this extension. <br />
    https://addons.mozilla.org/en-US/firefox/addon/textarea-cache/

  • How can I reduce the size of a pdf file for emailing?

    I want to send a pdf file which is 8 mb, it has bounced in an email because it is too big, how can I reduce the size of the pdf file for emailing?

    Sometimes a simple "Save As" will reduce the file size slightly, but probably not enough to pass the <8 mb threshold of your recipient, as you need.
    You've probably seen it, try the next option in the Save As menu, "Reduced Size PDF," and make it compatible with the latest version possible, again considering the recipient. This suggestion assumes Acrobat X. You don't say which version you're using, but this tool was available at least going back to Version 8, but in a different place, you'll have to hunt.
    If all that doesn't work, you could remove some images from the source document, which also will reduce the overall size.
    Best luck.

  • How can I reduce the size of a picture in iPhoto so it is small enough to post on the web.???

    How can I reduce the size ( Pixels) of a picture in Iphoto so I can post it on the web???

    You could also export the image and use your Preview application to change pixel dimensions.
    Open the image in Preview.
    Go to: Tools > Image size.
    Type in the dimensions you want.

  • For some apps it seems impossible to determine the price before, or even after, installing them. How can I get round this?

    For some apps it seems impossible to determine the price before, or even after, installing them. How can I get round this?

    Can you be clearer about what you're seeing?  The price should be clearly stated up front...  Is that not the case?  Note that there may be additional taxes that will increase the final price, and that can't be included in that up-front listed price, since taxes are different everywhere.

  • How can i reduce the number of calls archived in recents

    How can i reduce the number of calls archived in recents

    You can't change that.  It's a function of the OS and cannot be altered.

  • I just updated to ios5 but now can't sync because it's telling me my "other" section in the overview has grown to 10.2gig?!  What does that "other" section in the overview include and how can I reduce it to get my phone to sync??

    I just updated to ios5 but now can't sync because it's telling me my "other" section in the overview has grown to 10.2gig?!  What does that "other" section in the overview include and how can I reduce it to get my phone to sync??

    Thanks for the help.  The restore seems to have solved the problem.  I had a bit of a panic attack when things started going haywire and the Apple 'Support' told me to call back during business hours! 

Maybe you are looking for

  • Issues with Firefox hogging resources...

    I have several issues with Firefox intermittently consuming 99-100% of my CPU memory. Now, let me preface this by saying that I am NOT an advanced user, and can only tell you what I see on things like the Task Manager and such. Furthermore, I know th

  • System is not picking bank out going account in TBB1

    Hi All, I am facing the problem in TBB1 accounting entries, system is picking the bank main account (From House bank/account id assigned GL) Not picking Bank out going account from account determination Example: Accounting entry at the time of TBB1:

  • MRBR- Remove Blocking reason automatically

    Hi, we have below scenario: Invoice created for a vendor in MIRO with reference to PO withour GR. Payment Block "R-Invoice Verification"  is set in the invoice due to Quantity and Price Block. Now the requirement is to remove the Invoice block automa

  • What information does google display

    I have a full browser image which is the first thing you see when you go to my site, I have chosen to  "exclude page from the menu. It contains a "ENTER" link that takes you to the site content with navigation bar, it also contains only the Name and

  • Error loading metadata through parent child method

    Heirarchy Project (Dimension)->TotalProjects->Xseries->X1->a .........................................................X2->b .........................................................X3->c Project (Dimension)->TotalProjects->Yseries->Y1->j ............