Row Not form ExecuteQurey

Statement sql = con.createStatement();
ResultSet rs = sql.executeQuery("select * from emp);
How do you know if the executeQuery has returned any rows ? How do you test for row not found.
thanks

Therefore normally processing is done this way.
boolean haveResults = false;
while(rs.next()) {
  haveResults = true;
  // do your thing
If (!haveResults) {
  // no records were returned
}But you could do the following if the resultset is not forward only.
if(!rs.next()) {
  // no records were returned
else {
rs.beforeFirst() //move back to before first row
while(rs.next()){
  // do your thing
}or again if the resultset is not forward only.
int rowCount = (rs.last() ? rs.getRow() : 0);
rs.beforeFirst() //move back to before first row
if (rowCount == 0) {
  // no records were returned
else {
  while(rs.next()){
    // do your thing

Similar Messages

  • How do I set an Apex mulri-row reports form value for the specifc current row using Javascript?

    I have a multi-row region based on a table in which I have two particular columns of interest.  The first has an LOV defined for which I have set up a pick-list of codes associated with the item's status as "OK" or having some problem, for which there are a small number of set codes associated.  Most rows will be OK, but when there is a problem, the pick-list will be used.
    When that pick list has been used, there is an optional "comments" column that can be filled in.  I want my screen to dynamically enable/disable a pushbutton that links to the comment based on the code.  This being row-based, the push-button needs enabling or disabling by row, not as a whole "conditional column".  That bit is ok, I think, but I don't know and can't find the syntax for how within the javascript onchange function I set the current row value for a different column to the one that triggered it.
    My header function (that doesn't work) is going to be something like this (where the status column LOV having a value = 6 means "OK").  Note I'm using alert for a debug mechamism.  The $s line is my failed attempt to set he column value, here with a hard-coded string "Changed COMMENTS":
    <script type="text/javascript">
    function doActivateButton(object)
      if(parseInt(object.value)!='6')
        alert('It is not 6!');
        $s('#COMMENTS','Changed COMMENTS','Changed COMMENTS',TRUE);
      else
        alert('It is 6, you know!');
    </script>
    Ideally, I want any existing comments blanked if the user picks "OK" (6) as the new status, whereas for debug above I'm setting the hardcoded debug string.  You will probably also note I realise I haven't properly understood the purpose of the third parameter in the $s API.
    (This is a reports region, by the way.  A detail block, in forms-speak, with a header block above it.)
    Thanks for any assistance.
    Mark

    Sorry, versions are: Apex 4.1 on Oracle RDBMS 11.2.

  • Error in executing Std query -  Incorrect FRANGE row in FORM/DIM?FAC

    Hi,
    NOTE: We are on BI 7.0 Spport Pack 12 (SAPKW70012)...
    When I try to execute a query(one of the standard queries in HR - 0PA_C01_Q021), I got the following error messages:
    ABEND: Incorrect FRANGE row in FORM/DIM?FAC for InfoObject 0AGE
    ABEND: Incorrect FRANGE row in FORM/DIM?FAC for InfoObject 0ORGUNIT
    ABEND: Program error in class SAPMSSY1 method: UNCAUGHT EXCEPTION
    I searched the OSS and found a note 1001621 which said apply support package: SAP_BW_VIRTUAL_COMP - Rel 700 - Pkg name SAPK70012NVCBWTECH
    But, our basis guys came back with the reply that the solution suggested in OSS note is for SAPKW70011, but our system is already on SAPKW70012. So, this note cannot be applied.
    Is there any hidden solution out there? Please respond asap.
    Thanks

    Hi Raj and Sunny,
    Actually solution is very simple. You have to open this query in Query Designer and redefine the corresponding selection. The problem is that OLAP in BW 7.x is much more strict to query definition than in BW 3.x. Therefore queries from BW 3.x  are not accepted quite often. This error is just one example. So try to touch  the corresponding selection using hierarchy and save a query once again. For sure this will help. If not, create a message, we will look at the problem directly in your system.
    Best regards,
    Maxim

  • Allow edit only user's rows, not someone else's

    Hello
    as you know the option make Form and Report brings a report editable. Is there any way using that option to modify the report to make it non editable?
    OR
    more interesting, that only the user can edit his own row, not the rows of others. That is, there will be different users logging in separately and each willl be adding a row. is there a way one can edit only his row while he has no access to someone elses ?
    thank you
    Al
    Edited by: Alvaroe on 19-Nov-2009 15:29
    Edited by: Alvaroe on 19-Nov-2009 15:34

    Hi,
    maybe there is smarter way to make it, but I used to do it using CASE statement and javascript. I don't have working code, but that's the idea:
    1. In your report you have column with creator name - you use it in your SQL CASE statement like:
    SELECT some_columns, CASE created_by
      WHEN :APP_USER THEN '<a href="#" onclick="goToEditMode('||report_id||')">EDIT</a>'
      ELSE '-'
      END
    "EDIT" FROM your_tableNow if current user has created specified record, edit link appears in EDIT column.
    2. You must add hidden field (P_HIDDEN) to know which row has been selected to edit and javascript function that submits the page:
    <script>
    function goToEditMode(report_id){
    $x('P_HIDDEN').value=report_id;
    doSubmit('EDIT');
    </script>3. Last thing is to create branch that takes you to EDIT page when 'EDIT' request is sent by javascript function. Don't forget to set P_HIDDEN value to edit page in order to know which record is edited.
    Regards,
    Przemek

  • Empty report with pagination,  rows not displayed

    Dear HTML DB Team,
    We have in our reports the next error: An empty report with pagination appears , no rows not displayed
    The test case to reproduce the error:
    1. Create "SQL report" with next report attributes in "Layout and Pagination"
         a. Row ranges 1-15 16-30 in select list (with pagination)
    b. Number of Rows : 15
    c. Number of Rows (Item): empty
    d. Max Row Count: empty
    2. Fill the table on which the report is based with 17 rows
    3. Go to the 2nd page of the report , pagination rows 16-17 of 17
    4. Remove 2 rows from the table, refresh report
    5, The pagination shows now 1 - 15 of 15 rows
    - no rows displayed
    - no "previous button" ( only )
    - no way to get the rows displayed, except logging out and in again
    Any suggestions?
    Erik

    Hello,
    i encountered the same problem while developing in HTMLDB.
    In application builder, i select application Application 106, then click on items, then click next ( the application has 22 global items). Now i want to take a look at the global items in application 105 (there are only 5). In the menu i click Builder - Application 106, select application 105 from Available Applications, click Go and Items. It shows no rows, but says that is displaying rows 1-5, and offers a Next button. No way to see/modify the items unless make a new session or go back to Application 106, Click Previous to see the first page of global items and then again switch to Appication 105 or click to the next button and then manually set pg_min_row=1 in URL.
    One more question - is this forum the right place to report bug suspicions, or is there some other special place for that?
    Best regards,
    Andres

  • Why does front row not have simple organization?

    I currently have a hard drive hooked into my macmini which is hooked up to my TV. On my hard drive I have over 1000 movies, all purchased through iTunes. However when I use front row and i goto the movie section, I have to scroll through every movie to get to the one I want. There's no way to scroll by letter, only one by one. This is horrible and takes forever. Can apple do an update that makes the right button on the apple remote for scrolling letter by letter. For example, you click the right button to goto movies starting with B, C, D, E, F, etc. Then the down button for one by one scrolling. Also, why does front row not have genres? AppleTV does. Why not incorporate that into front row? Think, Apple, Think.

    You can have sub-folders in the Movies folder and arrange your movies alphabetically that way.
    But if you want to alert Apple to your idea, then use this link:
    Where to send product feedback to Apple:
    http://www.apple.com/feedback/

  • Redundancy not forming with wlc

    Hi,
    We have two wlc 5508 running vers 7.4.100.60. They are not forming redundancy pair & are in maintenance mode.
    Both RP's are connected physically direct.
    Few outputs are given here:-
    (WLC01) >show redundancy summary
    Redundancy Mode = SSO ENABLED
         Local State = MAINTENANCE
          Peer State = UNKNOWN - Communication Down
                Unit = Primary
             Unit ID = 2C:11:5A:5F:C7:00
    Redundancy State = Non Redundant
        Mobility MAC = 2C:11:5A:5F:C7:00
    Maintenance Mode = Enabled
    Maintenance cause= Negotiation Timeout
    Redundancy Management IP Address................. 10.32.25.11
    Peer Redundancy Management IP Address............ 10.32.25.12
    Redundancy Port IP Address....................... 169.254.25.11
    Peer Redundancy Port IP Address.................. 169.254.25.12
    (WLC02) >show redundancy summary
    Redundancy Mode = SSO ENABLED
         Local State = MAINTENANCE
          Peer State = UNKNOWN - Communication Down
                Unit = Secondary - HA SKU
             Unit ID = 10:B3:21:3C:01:B0
    Redundancy State = Non Redundant
        Mobility MAC = 10:B3:21:3C:01:B0
    Maintenance Mode = Enabled
    Maintenance cause= Incompatible Software license
    Redundancy Management IP Address................. 10.32.25.12
    Peer Redundancy Management IP Address............ 10.32.25.11
    Redundancy Port IP Address....................... 169.254.25.12
    Peer Redundancy Port IP Address.................. 169.254.25.11
    (WLC01) >show license summary
    License Store: Primary License Storage
    StoreIndex:  0  Feature: base                              Version: 1.0
            License Type: Permanent
            License State: Active, Not in Use
            License Count: Non-Counted
            License Priority: Medium
    License Store: Evaluation License Storage
    StoreIndex:  0  Feature: base-ap-count                     Version: 1.0
            License Type: Evaluation
            License State: Active, Not in Use, EULA not accepted
                Evaluation total period:  8 weeks  4 days
                Evaluation period left:  8 weeks  4 days
            License Count: 500 / 0 (Active/In-use)
            License Priority: None
    (WLC02) >show license summary    
    License Store: Primary License Storage
    StoreIndex:  0  Feature: base                              Version: 1.0
            License Type: Permanent
            License State: Active, Not in Use
            License Count: Non-Counted
            License Priority: Medium
    License Store: Evaluation License Storage
    StoreIndex:  0  Feature: base-ap-count                     Version: 1.0
            License Type: Evaluation
            License State: Active, Not in Use, EULA not accepted
                Evaluation total period:  8 weeks  4 days
                Evaluation period left:  8 weeks  4 days
            License Count: 500 / 0 (Active/In-use)
            License Priority: None
    In addition, other errors are also seen during the process.
    Starting Redundancy: Starting Peer Search Timer of 120 seconds
    Cannot open the file /mnt/application/ha/InheritedApCount.txt
    Cannot open the file /mnt/application/ha/InheritedApCount.txt
    Please help with all possible suggestions. thanks in advance

    Hi,
    i cant see that you have permenant AP count license on both.
    review the following document for licensing requirement on AP SSO
    http://www.cisco.com/en/US/products/ps10315/products_tech_note09186a0080bd3504.shtml#licensing

  • Can LC Designer produce a flat PDF, not form, as a template for dynamic content?

    Can LiveCycle Designer produce a flat PDF, not form, as a template for dynamic content?

    Yes that means LiveCycle Designer .....the XDP is an XML file that describes the template that you want. It is turned into a PDF by the Designer as well as the LC Server I mentioned. The Designer creates interactive content (not what you asked for), the server can do the same as well as flat PDFs. I mentioned the batch mode because that is how people generally use it or they use it for real time creation of the reports but it tends to be high volume (it is a server product so it will bepriced that way). You can create an XDP that has text and "floating fields" on it. Floating Fields are special in that you can merge data with the template and once the data is put into the field it is turned into text (non-interactive). This woudl be useful for testing (requires a  hands on approach) but if there is any kind of volume that you are looking for this will not be useful. The server side can be automated so that no human intervention is required.
    Paul

  • Download page will not form correctly

    The webpage for downloading iTunes 6 does not form correctly. There is not a link to begin the download.

    hi y'all!
    if you're seeing a blank blue box on the itunes download page, the usual suspect is
    b McAfee Privacy Service.
    (it causes a similar problem on the ipod software updater download page, too.) see the McAfee entry here:
    b noir, "the conflict apocrypha", 10:07am Aug 18, 2005 CDT
    ... and also see related posts in the thread by btabz and Blandine Catastrophe.
    love, b

  • I have trouble with iCloud. I doest show my notes form my iPad?

    I have trouble with iCloud. I doest show my notes form my iPad?

    My car broke last week.  Can you tell me what's wrong with it?

  • ImportTextData fails with an error: row not found

    In am using Acrobat XI.  In a js script in an action wizard the statement this.importTextData("mypath", 0) continues to return a 3 "error: row not found".  I have checked the path and it is correct.  The text file was created by Access 2013 and is tab delimitated.  What am I doing wrong?  The top row in the txt file is the column names and there are 3 rows of data. 

    What happens when you try to import from the data file manually?
    If you have a field named "A.0" as you said, you have to have a matching column header, but you said you just have "A", "B", and "C".

  • DM 10.0 "Row not found or changed." error on Data Cache Update

    Hi everyone,
    I'm trying to send data from FC to DM Data Cache.
    Tasks on the FC side are running fine. On the DM side, task engine always has the "Failed" Status:
    and when I check the logs, only explanation I find is "Row not found or changed". :
    I tried many things yet the error persists:
         -I tried sending data from different systems. (test & production)
         -I checked the CPU and Memory consumption on the server and there seem to be no peak.
         -I unchecked the parallel processing option on excel workbook.
    Can anyone help on the issue? Any ideas?

    Hi Folu,
    Yes it points the TaskEngine and I've already followed the steps in note: 2014782 and the error message in the logs does not give any explanation to me.
    Log is like this:
    16-01-2015 09:42:32.4284 [6] [ERROR] ==>
    -------- Begin --------
    ErrorID: 6a344894-5a11-4392-9537-ec9ec2b496fe
    Message: Row not found or changed.
    -------- End --------
    And the trace log is as follows:
    16-01-2015 09:42:32.4284 [6] [ERROR] ==>
    -------- Begin --------
    ErrorID: 6a344894-5a11-4392-9537-ec9ec2b496fe
    Error in path: Unknown
    Raw url: Unknown
    Message: Row not found or changed.
    Source:
    System.Data.Linq
    Stack trace:    at System.Data.Linq.ChangeProcessor.SubmitChanges(ConflictMode failureMode)
       at System.Data.Linq.DataContext.SubmitChanges(ConflictMode failureMode)
       at SAP.DM.TaskEngine.Context.ImportData.ImportDataContextRepository.Save(StagingAreaImportRequestItem item)
       at SAP.DM.TaskEngine.Context.ImportData.ImportDataContext.ProcessTask(ITask task)
       at SAP.DM.TaskEngine.Core.TaskDispatcherBase.Dispatch(ITask task)
       at SAP.DM.TaskEngine.Core.TaskManager.ProcessTask(ITask task)
    -------- End --------
    The other notes do not apply to our case.
    Do you have any clue about where to look for the cause?
    BR.
    Mehmet.

  • I have many pdfs that have the identical structure, but are NOT forms. How can I collect this data?

    I have dozens of pdfs which have the identical structure, but are NOT forms. I would like to collect data across these pdfs to analyze. Is there a way to do this?

    There are a number of ways that text can be extracted, but it may not be in the order that you'd expect or want. But if it's consistent in any case, you should be able to get at the content you're interested in. JavaScript can be used to loop through the "words" on a page, for example. I've used this approach for several projects that required data extraction.

  • How to make some rows not selectable in AdvancedDataGrid

    Hi there,
    I have an advanced data grid which allows to select multiple rows. I need to make certain rows not selectable dependent on the row data. How can this be done?
    Help is greatly appreciated. Thanks in advance.
    --Charmaine

    Hi, You can view same demo here
    Thanks and Best regards,
    Pallavi Joshi | [email protected] | www.infocepts.com

  • Row Not Found from executeQuery

    Statement sql = con.createStatement();
    ResultSet rs = sql.executeQuery("select * from emp);
    How do you know if the executeQuery has returned any rows ? How do you test for row not found.
    thanks

    I'm a bit unclear on what this topic is about . Are you trying to prove a point that you could write a driver that works the way you say and still be within JDBC specs, or are you actually having a problem? I've used JDBC Drivers from many vendors and the code I gave you would work with all of them as described. The following was cut and pasted from the online docuementation and would appear to is is from the Java Doc for the ResultSet Interface and it seems to validate that the code I gave you is correct (assuming that a null ResultSet cannot be returned when using executeQuery).
    "A ResultSet object maintains a cursor pointing to its current row of data. Initially the cursor is positioned before the first row. The next method moves the cursor to the next row, and because it returns false when there are no more rows in the ResultSet object, it can be used in a while loop to iterate through the result set. "
    Here is the online documentation that states that a ResultSet will NEVER be null when invoking executeQuery:
    executeQuery
    public ResultSet executeQuery(String sql)
    throws SQLExceptionExecutes the given SQL statement, which returns a single ResultSet object.
    Parameters:
    sql - an SQL statement to be sent to the database, typically a static SQL SELECT statement
    Returns:
    a ResultSet object that contains the data produced by the given query; never null
    Throws:
    SQLException - if a database access error occurs or the given SQL statement produces anything other than a single ResultSet object
    So, I would reiterate that this is not a code problem. If you are getting an Exception, then the problem lies elsewhere.

Maybe you are looking for