How do I get a subset of a result set

I am getting a result set from a remote data source. After the resultset is returned how can I do a select on the result to return a subset of records?
My code:
package com.drawingpdmw1;
import java.sql.*;
import com.ibm.as400.access.*;
* @author sde
* TODO To change the template for this generated type comment go to
* Window - Preferences - Java - Code Style - Code Templates
public class getLastDashNumberConnection {
     public String errorString;
     public String literalerrorString;
     public String maxRecSeq;
     public getLastDashNumberConnection(String arg0) {
                  AS400JDBCDataSource datasource = new AS400JDBCDataSource("gvas400");
             datasource.setTranslateBinary(true);
             datasource.setUser("drawchg");
             datasource.setPassword("webabc1");
             try{
                  Connection connection = datasource.getConnection();
                 Statement stmt = connection.createStatement();
                 String sql = "select distinct dmdrawno from webprddt6.drawmext3 Where dmdrawno LIKE '%" + arg0.substring(0,6) + "%'";
                 ResultSet rs = stmt.executeQuery(sql);
                 while(rs.next()){
                      System.out.println(rs.getString("dmdrawno").trim());
                 errorString = "";
                 literalerrorString = "NoError";
             catch(SQLException sqle){
                  System.out.println("Error");
                  System.out.println(sqle);
                  errorString = "Warning!!! A New Dash Number could not be created!";
                   literalerrorString = "Error";
}

First, thanks for the info on closing my objects.
Now as far as the data here is my situation. The purpose of this class is to return the next dash number that can be used for a series of partnumbers. In most cases the series is constructed with only one type of dash numbers. Example: -401, -403, -405 dashes that start with a 4 are assemblies. This is easy to figure out the nex dash(-407).
However, some of our partnumber series have dashes like -001, -003, -005 which are detail level part numbers along with the -401 etc.
Now a user needs to create a new dash number. First, is this a detail dash or an assy dash. My idea is to get all the possibilites for a series, check for dash types, then return the next dash for each type.

Similar Messages

  • How do I get the Measurement scale to stay set in Adobe Acrobat IX Pro. It's easy to set the scale , but when you exit out of the commend

    How do I get the Measurement scale to stay set in Adobe Acrobat IX Pro. It's easy to set the scale , but when you exit out of the commend the scale is reset to 1 = 1.

    Thank you for checking, Tom,
    I'm confused. What do YOU get when you push the feed button? And why is it working on yours and not either of my machines?
    Today, my Mac (w/Safari 4) gets the same error message: Safari can’t open the page Safari can’t open the page “feed:http://vibrationalvoyages/vibrationalvoyages.com/DivineLight_Vibrations_Principles_andApplications/rss.xml”. The error is: “The feed could not be loaded because the content is not in a known feed format.”
    My little ASUS (with a Linux operating system) gets a screen that says "The requested URL was not found". The URL on that page is http://vibrationalvoyages./vibrationalvoyages.com/DivineLight_Vibrations_Principles_andApplications/rss.xml
    On both error messages, the URL I was checking was:
    http://www.vibrationalvoyages.com/DivineLight_Vibrations_Principles_and_Applications/Divine_Light_Vibrations_Principles_ andApplications.html
    The last URL was, of course, the URL generated by iWeb.
    So, my question still is:
    HOW CAN I GET MY FEEDS TO WORK PROPERLY? If the problem is there shouldn't be an http:// after feed: then, how do I get iWeb to set it up properly?
    Any ideas?
    GG

  • How can I get the PDF to retain margins set in Word document?

    Uploaded a Word 2003 document for conversion. Conversion to PDF successful, but the PDF has different margins and page breaks. How do I get the PDF to retain the set margins?

    Hi NancyS,
    If you're on Windows, you can try using the PDF Desktop printer to "print" your document to PDF format. Here are the instructions for installing and setting up the PDF Desktop printer: Install and configure Adobe CreatePDF Desktop Printer.
    Please let us know if you have better luck using the PDF Desktop Printer.
    Best,
    Sara

  • How do I get my voyager 510 bluetooth head set to work

    How can I get my VOYAGER 510 Bluetooth head set to work it pars up gut no sound only through speakers

    Per the following your headset uses the HFP or the HSP profile.  The iPod only supports the A2DP profile for headphones.
    http://plantronics.custhelp.com/cgi-bin/plantronics.cfg/php/enduser/std_adp.php? p_faqid=8079&p_created=1125099403&p_sid=OoSQvBuk&p_accessibility=0&p_redirect=&p _lva=&p_sp=cF9zcmNoPTEmcF9zb3J0X2J5PSZwX2dyaWRzb3J0PSZwX3Jvd19jbnQ9MzgsMzgmcF9wc m9kcz0mcF9jYXRzPSZwX3B2PSZwX2N2PSZwX3NlYXJjaF90eXBlPWFuc3dlcnMuc2VhcmNoX25sJnBfc GFnZT0xJnBfc2VhcmNoX3RleHQ9UGxhbnRyb25pY3MgVm95YWdlciA1MTA!&p_li=&p_topview=1
    Aslo see:
    iPhone, iPad, iPod touch: Supported Bluetooth profiles

  • Itunes 10.6.1.7 I have 2 sets of playlists the first set displays greyed out lists and does not work The second set is fine. How do I get rid of the non working set of playlists?

    I have 2 sets of playlists in the sidebar of itunes. I have recently upgraded to 10.6.1.7 but this condition remains the same
    The top list refers to greyed out listings and does not function
    The list below works fine
    How do I get rid of the "false" list?

    I think the greyed out playlists must be listed from your device which is set up to mirror your library. Because the device is synced you can't edit content directly on the device. From the top of the left-hand column do you have?
    Library > Music, Movies...
    Store > iTunes Store, iTunes Match...
    Devices > <Your Device> > Music, Movies, and all the other "dummy" lists...
    Genius > Genius, Genius Mixes...
    Playlists > iTunes DJ, and then all your playlist folders and playlists...
    If so then that is perfectly normal when your device is connected, either directly or over wi-fi and you have the lists expanded. Simply click the small triangle to the left of the device name to hide all the playlists.
    tt2

  • My Facebook account has bein deleted how can I get it back to my iPad setting

    My Facebook account has bein deleted how can I get it back to my iPad setting

    Apple ID: "This Apple ID has been disabled for security reasons" alert appears
    http://support.apple.com/kb/ts2446
    Contact Apple Support
    https://expresslane.apple.com/GetproductgroupList.action
     Cheers, Tom

  • FILES: how do I get rid of EXEC status and set them to open with "none"?

    I dropped my laptop and damaged the drive. My computer forensic friend salvaged specific files.
    Transfered to a FAT32 drive and then copied to Mac.
    Most of files are fine with the exception of some setings files that showed up as Unix executables. The few original files that I have to compare them to, show "Document" as the file "Kind" and the "open with" shows "none" in Get Info
    When I look at the contents of the files they look fine. How do I get rid of the EXEC status and set them to open with "none"?
    Any help would be greatly appreciated.
    These are settings files for a set of .wav samples for an AU drum plug-in.

    If you have xcode installed, you might want to find out what the type and creator code for these files should be. Since the files have visited a FAT32 file sytem, you will have lost all resource forks as well as type and creator HFS+ meta data.
    So assuming you do have xcode, create a new AU drum plug-in file then in the terminal:
    <pre style="padding-left: .75ex; padding-top: .25em; padding-bottom: .25em; margin-top: .5em; margin-bottom: .5em; margin-left: 1ex; max-width: 80ex; overflow: auto; font-size: 10px; font-family: Monaco, 'Courier New', Courier, monospace; color: #444; background: #eee; line-height: normal">/Developer/Tools/GetFileInfo newfile</pre>
    Then use:
    <pre style="padding-left: .75ex; padding-top: .25em; padding-bottom: .25em; margin-top: .5em; margin-bottom: .5em; margin-left: 1ex; max-width: 80ex; overflow: auto; font-size: 10px; font-family: Monaco, 'Courier New', Courier, monospace; color: #444; background: #eee; line-height: normal">/Developer/Tools/SetFile -t '(insert type)' -c '(insert creator)' oldfile</pre>
    If there's a lot of these you might automate the process using the find command.
    Cole

  • Moving controls about on a VI's front panel. How do you get a reference to a 'grouped' set of controls?

    Basic problem (annoying, if not disasterous - but common - at least for me):
    When you are trying to sktick two different VIs together and you copy the block diagram of one to the other, it sticks all the controls in the middle of nowhere.  THen you have to spend about 10 mins dragging the controls screen by screen from one end of the diagram to the other - sometimes over 15 screens.  Surely there has to be a better way?
    ** Incidentally you might think that labview would have these sort of settings in the 'properties' of the control on the right click menu - but no joy.
    I guess the obvious thing is that you can write a VI which will get a reference for a particular control and then say set it's position (x,y) to zero.  Only thing is that generally there will be a selection of controls, and often they will be organised nicely - after getting them to zero you don't want to have to reorganise them again.  I tried grouping the controls, but then the problem is - how do you get a reference to a group of controls.  If you move one of them it doesn't keep the spatial arrangement.  At this point i have got lost - and easily spent more time than it is worth fixing this problem.
    Any thoughts?
    Solved!
    Go to Solution.

    If I understand you correctly, when you copy the block diagram from the second VI to the first, the controls of the second VI end up in far left field on the front panel of the first, correct?  I think these added controls will maintain their relative locations among themselves so you should be able to find them all as a group out in left field. Then it's simply a matter of how to get them to enmasse join the rest of the controls on the front panel. There are a couple of easy ways to do this. There is a button on the toolbar at the top of the front panel window that allows you to reorder/group/ungroup front panel objects. You can select all controls/indicators out in left field and "group" them together. (As an alternative, you can also drop them all onto a tab control which will act as container for them). Then you select this group and with it selected scroll back over to the existing front panel and find and ALSO select (hold down shift key) a control/indicator from the existing group too. Then with BOTH the existing control selected and the new group (or tab control with the new group) selected you use the ALIGN buttons to quickly bring a corner of the new group into alignment with the old control. At that point you can ungroup the new stuff and move it where it needs to be. 

  • How do I get MAIL mailbox passwords to stay set?

    I've recently upgraded to OS 10.4.9 and my MAIL mailbox passwords will not stay set. I am asked for the password for each mailbox every time. I've tried all the suggestions/instructions in Mail help but my save password check is always ignored. Any suggestions s to how i can get MAIL to behave as it's supposed to?

    Open /Applications/Utilities/Keychain Access, choose Keychain First Aid from the application menu, and proceed to repair the keychain. If that doesn’t work, try removing the password entries from the keychain and letting Mail create them again the next time it asks for them.
    If the problem persists, try this:
    1. In Keychain Access > Preferences > General, click Reset My Keychain and proceed as requested. A new (empty) login keychain should be created and the old one renamed and removed from the keychain list, but not deleted.
    2. You can add the old (renamed) keychain (stored in ~/Library/Keychains/) back to the keychain list by clicking the [+] button in Edit > Keychain List.
    3. You can move/copy password entries from the old keychain to the new one if wish.

  • How do i get off itunes being my default setting please

    i dont want itunes as my default programme,how do i now change this after having selected it

    Kappy,  Apologies for not being clear.  What I want to know is how do I get the automatic sleep function to automatically include turning off iTunes?  As it now stands, the computer goes into sleep mode after the amount of time I set in System Preferences, but iTunes continues to play.  I want to listen to iTunes while I am falling asleep, then have it go off after I am asleep, like a clock radio with a "slumber" button.

  • Getting the record count from result set

    i'm retreiving the result set using the executeQuery method, now i want to know how many records are there in the result set, that is the record count of the result set.
    one solution to that is to first use the executeUpdate and then use the executeQuery but i think that is not the right way.
    so please tell me is there any method in jdbc to get that thing done
    Tanx

    Hi
    Do you know if your DB supports "insensitive scrolling"?
    SQL generally do, but some don't - I had the same problem with the
    open source version of Interbase from Phoenix...
    Anyway - try creating your statement this way:
    public Statement createStatement(int resultSetType, int resultSetConcurrency)
    throws SQLException
    ...where resultset type should be:
    ResultSet.TYPE_SCROLL_INSENSITIVE
    Then you can do this:
    ResultSet rs = stm.executeQuery(q);
    int size = rs.last(); //this what you looking for?
    rs.beforeFirst();
    while(rs.next()){
    }

  • Getting specific row of the result set.

    table: employee
    empno           number(20)
    ssan           varchar2(9)
    date_time_stamp date
    My Sql gets all the empno where ssan and date_time_stamp are equal.
    However I need previous row from max(empno) where ssan & date_time_stamp are equal.
    For eg:
    empno     ssan           date_time_stamp
    100     123456789     01-FEB-2004
    101     000000000     02-FEB-2004
    102     123456789     01-FEB-2004
    103     123456789     01-FEB-2004
    105     123456789     01-FEB-2004
    I need row with empno = 103.
    My current sql fetches all rows for particular ssan where ssan and date time stamp are equal that fetches all empno for particular ssan and date time stamp. I want the max(empno) -1 (previous row of the result set).
    Here is my sql:
    select empno,ssan,date_time_stamp
    from employee e
    where date_time_stamp in (select date_time_stamp from employee where e.ssan = ssan)
    order by empno,ssan;
    The above sql will fetch
    empno     ssan           date_time_stamp
    100     123456789     01-FEB-2004
    102     123456789     01-FEB-2004
    103     123456789     01-FEB-2004 ---&gt; I need this row, previous row from max(empno) where ssan and date time
    stamp are matching.
    105     123456789     01-FEB-2004
    101     000000000     02-FEB-2004

    If I understand correctly, you want the second highest empno for each unique combination of ssan and date_time_stamp. If so, given
    SQL> SELECT * FROM employee;
         EMPNO SSAN      DATE_TIME_S
           102 123456789 01-feb-2004
           103 123456789 01-feb-2004
           105 123456789 01-feb-2004
           100 123456678 01-feb-2004
           102 123456678 01-feb-2004
           103 123456678 01-feb-2004
           101 000000000 02-feb-2004
           105 123456678 01-feb-2004
           100 123456678 02-feb-2004
           102 123456678 02-feb-2004
           103 123456678 02-feb-2004
           105 123456678 02-feb-2004
           100 123456789 01-feb-2004Then something like this should do it.
    SQL> SELECT empno,ssan,date_time_stamp
      2  FROM (SELECT empno,ssan,date_time_stamp,
      3               RANK() OVER (PARTITION BY ssan,date_time_stamp
      4                            ORDER BY empno DESC) rk
      5        FROM employee)
      6* WHERE rk = 2;
         EMPNO SSAN      DATE_TIME_S
           103 123456678 01-feb-2004
           103 123456678 02-feb-2004
           103 123456789 01-feb-2004HTH
    John

  • How do I get rid of the moderate nat setting on my xbox 360?

    I tried following the link in a previous threads but it doesn't seem to work. I have wrt54g wireless G braodband router. I'm also running on firefox. I want my router to say open not moderate, so I can play Halo with my friend.

    Open routers set up page using http://192.168.1.1 ….you will get username & password screen …leave username blank & under password use admin.
    Click on “applications & gaming” tab…under port range forward use 88 & 3074 ports forwarded for Ip – 192.168.1.50….check enable….click save settings.
    Click on set up look for MTU …make it manual …change the size to 1365
    On X-BOX use static Ip …subnet mask…gateway & DNS numbers as on routers set up page.
    Also configure the wireless settings same as in router.
    Let me know if the connection still shows NAT moderate.

  • Since I have synced my contacts with Hotmail, I can no longer use relationships. How can I get this back without having to set up another email account?

    I am currently using Hotmail with syncing enabled for mail and contacts. However, I cannot find or add the fields for family members or any relationship other than manager and assistant. I cannot add the fields manually, nor can I get Siri to assign the proper relationship to the right person (everyone defaults to manager or assistant).
    I'd really prefer not to have to use a different email address just to be able to use the phone; however, up until I synced the accounts I was able to edit relationships. Can anyone help me out?

    This is a limit with an Exchange account.

  • HT201442 how do i get through the passcode screen to set my iphone back up

    i am trying to us my old iphone because my current one broke. my old one is disabled from trying the passcode too many times, so i am trying to get through it. the phone is not activated because i cant get through it!

    You don't.
    It is all or nothing.
    You should be syncing contact with your computer regularly, so they should be in whatever program you have chosen to sync.
    You should be importing all pics regularly, so they should be on your computer as well.

Maybe you are looking for

  • Hard drive damaged - replace it myself?

    My computer crashed the other day, and a technician came over and after it wouldn't mount on his computer, and made some awful noises trying to start up, he declared the hard disk dead. I live in Costa Rica, so getting service is a pain. The tech off

  • Uploading in Lightroom

    I have been uploading some web galleries with lightroom for a horse show.  The first gallery I uploaded, went just fine.  However, the others I have uploaded, I have noticed  I get an error of  "An error occurred sending the file: a response was not

  • How do I add Info to My TV Shows from Filename

    I have 30 different TV series on my computer that I'd like to play on my ATV3. When I add the videos the process to get them into TV shows is this: Add folder to library Move the TV Shows I added from Home Videos to the TV Shows Section Get Info for

  • Deleted songs from iTunes In The Cloud.  How do I get them back into iTunes In The Cloud?

    I  accidentally deleted some purchased songs from iTunes In The Cloud when I was using iTunes 11.  How can I get them into iTunes In The Cloud again?

  • Adobe X and PDF Packages

    I previously used Adobe 8 Standard to create PDF packages, I can't seem to find the feature in the new Adobe X Standard.  Can anyone help point me in the right direction? Thanks