Check booking whether exist

hi all, how can i check the booking exist or not before add booking??thanks
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
           Connection con = DriverManager.getConnection("jdbc:odbc:booking");
           PreparedStatement pstat = con.prepareStatement("insert into booking values(?,?,?,?,?,?,?,?)");
               memberno = tf1.getText();
               pstat.setString(1,memberno);
               facilityno= ch1.getSelectedItem();
               pstat.setString(2,facilityno);
               date = ch2.getSelectedItem();
               pstat.setString(3,date);
               time = ch3.getSelectedItem();
               pstat.setString(4,time);
               int no1 = (int) (Math.random()*10000);
            String referenceno = String.valueOf(no1);
            tf2.setText(referenceno);
              pstat.setString(5,referenceno);
            pstat.setString(6,"accepted");
               collectiondate = date;
            tf3.setText(collectiondate);
            pstat.setString(7,collectiondate);
               collectiontime = time;
               tf4.setText(collectiontime);
            pstat.setString(8,collectiontime);
               pstat.executeUpdate();
               tf1.setText("");
           pstat.close();
           con.close();
[\code]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  

2 errors,
method getSelectedItem(int), location:interface java.sql.ResultSet
String date1 = String.valueOf(rs.getSelectedItem(1));
method getSelectedItem(int), location:interface java.sql.ResultSet
String time1 = String.valueOf(rs.getSelectedItem(2));
thanks
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
           Connection con = DriverManager.getConnection("jdbc:odbc:booking");
        PreparedStatement ps = con.prepareStatement("select date, time from booking where date = ? and time = ?");
           ps.setString(1,ch2.getSelectedItem());
           ps.setString(2,ch3.getSelectedItem());       
        ResultSet rs = ps.executeQuery();
        while (rs.next()){
          String date1 = String.valueOf(rs.getSelectedItem(1));
          String time1 = String.valueOf(rs.getSelectedItem(2));
              if (date.equals(date1) && time.equals(time1)){
               JOptionPane.showMessageDialog(this,"booked.");
               booking bk = new booking();     
               bk.setVisible(true);
         rs.close();
         ps.close();
[\code]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

Similar Messages

  • Report to check "Book Qty & Counted Qty" in Warehouse Management

    Hi All,
    In MI24, I can see "Book Qty & Counted Qty" in Inventory Management.
    But, Is there any report to check "Book Qty & Counted Qty" in Warehouse Management.
    If any report is there, let me know the T-Code.
    Regards
    Siva

    if you know the inventory record and the warehouse number, you can fetch the information from table LINV. Input warehouse and inventory record. The fields GESMA and MENGE/MENGA give the book quantity and counted quantity respectively.
    Regards,
    Rajiv..

  • Can i set up address book from existing list ?

    i want to set up address book from existing list
    in addition to address i want to include phone #, email

    Can you provide more information? Are you trying to gather data via a form to built an address book? You can make a form and ask for people phone number, email, address... I'm not sure what is your 'existing list'. Is it in an excel document? You would have to merge the data collected via the form manually to you existing list.
    Gen

  • Check for index existing

    I'm a DBA working with 3 application developers, they want to know how to check for index existing for certain column
    in a table in their schema,
    one friend told me , to check for index existing for certain column you have to query
    the view dba_ind_columns so you have to be a sysdba user
    but I don't want to grant the application developers the sysdba privilage
    but my friend told me , to avoid grant sysdba to the application developers, they can query the view user_indexes in their schema, but after watching the view user_indexes ,
    it gives me a lot of data but doesn't give me the COLUMN NAME
    how can I solve this problem which is :
    Allow the application developers to check for index existing for certain column in their schema without granting them sysdba privilage.

    You can use that query:
    select ai.index_name INDEX_NAME,
    substr(ic.column_name, 1, 30) COLUMN, ic.column_position POSITION,
    ic.table_name TABLE,
    ai.tablespace_name TABLESPACE
    from all_ind_columns ic, all_indexes ai
    where ai.index_name = ic.index_name and ai.table_name = 'TABLE_NAME' and ai.table_owner='OWNER'

  • How to check any directory existance in TestStand?

    How to check any directory existance in TestStand?
    Is there TestStand function? Or other option without writing my own code in external program (e.g. LabVIEW or C)?
    Thanks in advance
    Solved!
    Go to Solution.

    At Least according to the NI TestStand 2012 documentation, Engine.FindPath and Engine.FindFile work only within the NI TestStand SearchDirectories.
    Maybe related: remote paths (\\server\path\to\file.ext) are considered "invalid" by Engine.FindPath.

  • How  to check  table have  exists any views in oracle

    hi,
    how to check table have exists any views in oracle

    SELECT * FROM user_dependencies
    WHERE type='VIEW'
    AND referenced_type='TABLE'
    AND referenced_name ='Your_Table_Name' You may use dba_dependencies to find views in different schema.

  • How to check one table exist or not in SAP

    Hi, Gurus:
    How to check one table exist or not in the SAP.
    Thanks,

    Hi,
    Query the table DD02L..
    Select single * from DD02L where tabname = 'Your table name'
                          AND TABCLASS = 'TRANSP'.  " For transparent tables.
    Thanks
    Naren

  • How to check/count whether child records with specific type exist?

    Hi
    We need to create a BIP report based on data from Siebel.
    In Siebel we have two entities:
    Entity <Mandate> = Parent Business Componet
    Entity <Attachment> = Child Business Component
    (An attachment has a specific type attribute (e.g. “contract”, “appendix” and lot of others…)
    Relationship between Mandate and Attachments is 1-m.
    We need to create a BIP report which displays all Mandates records which do not have at least two Attachments child records (there must be one attachment child record with type=”contract’ and another with type “appendix”). How can we check in BIP whether these child records with a specific Attachment type exist? And if not, display the Mandate in a list....
    Many thanks
    Alen

    Thanks for your help
    Well I'm not sure about the syatax I have to use in order to filter on the field *<GAMDocumentType>*
    The structure of the xml we use is as follows:
    <ListOfBipJbAmlMandateAttachmentReport>
    <JbAmlMandate>
    <ListOfJbAmlAttachment>
    <JbAmlAttachment>
                   <AccntFileName>DocumentPage_713328</AccntFileName>
                   <GAMDocumentType>*contract</GAMDocumentType>
                   <MandateId>1-4C79B</MandateId>
                   <Status>Active</Status>
    </JbAmlAttachment>
    I tried <?for-each:JbAmlMandate[count(./JbAmlAttachment[GAMDocumentType='contract']) > 1 and count(./Attachment[type='appendix']) > 1]?>
    But this returns nothing.
    Many thanks for your help
    Saggittarius

  • Inserting blank page for ads according to datamerged field.checking for whether a variable exists on

    Let me see if I can explain what I am trying to do. I have a script which loops through pages of an indesign document. I use a for loop to do so.
    Within each page is a text frame called "Advertising" with a Y or N as the value. If the value is Y, I want to insert a blank page before the page with the advertising field. Within the for loop however, there are calls to other data fields. My issue is that when I add a blank page, and the for loop continues, it errs out because the blank page does not contain the variable fields I am using. (highlights)...
    So my question is, how can I cause the for loop to skip the newly inserted page so that the missing variable doesn't cause the script to fail?
    should I be checking whether the layer exists then doing something like:
    if(newDoc.pages.item(i).pageItems.item("CompanyHighlights").length > 0){}
    for(var i = o; i < PageLength-1; i++){
    //some kind of check to determine whether it's a blank page, or a page with the variable.
         if(newDoc.pages.item(i).pageItems.item("CompanyHighlights").length > 0){
              var highlights= newDoc.pages.item(i).pageItems.item("CompanyHighlights").contents;
              var advertising = newDoc.pages.item(i).pageItems.item("Advertising").contents;
              if(advertising == "Y")
                   //add blank page before this page

    Thanks Hans, I actually got it working last night: I had to run a double if statement to check the Master page and move the counter var to a global var, and then add 1 to the counter "i" since I was adding a page, and add 1 to the PageLength so the for loop can continue on the pages that were moved ahead a page number by adding a page...not the best solution, but it works and I'm on a deadline. Thank you for trying to help though.
    //make i a global variable
    var i = 0;
    for(i = 0; i < PageLength-1; i++){
    //define master page of current page in the loop
    var masterpage = newDoc.pages.item(i).appliedMaster.name;
    //if its C-Master, skip it
        if(masterpage  != "C-Master"){
           //if it contains the merged Advertising field add a page
          var advertising = newDoc.pages.item(i).textFrames.item("Advertising").contents;
              if(advertising == "Y")
                   //Add a page.
                   newDoc.pages.add(LocationOptions.before, newDoc.pages.item(i) );
                   newDoc.pages.item(i).appliedMaster =app.activeDocument.masterSpreads.item("C-Master");
                   i=i+1;
                   PageLength = PageLength+1;
    var masterpageAgain = newDoc.pages.item(i).appliedMaster.name;
                if(masterpageAgain  != "C-Master"){
                   var highlights=newDoc.pages.item(i).textFrames.item("CompanyHighlights").contents;

  • Check whether existing row exist, if does not exist,then insert else skip?

    let say, in a mapping , I have a external table and a normal db table
    , I want to check if current row is similar/exist, if it exist, record row will be skipped and wont be re-inserted again
    only if it does not exist, then that particular row will be inserted.
    can I do this with a lookup? But I have no idea how.. any guidance thank!
    Edited by: 854616 on May 9, 2011 8:41 PM

    You can use the joiner
    Say you have employee_src table (Source) and employee_tgt (target) and employee_id is the primary column and if the employee_id exist in target table then skip the records.
    then
    Join
    employee_src.employee_id = employee_tgt.employee_id(+)
    then apply the filter where employee_src.employee_id is null
    then load them to target table..
    Cheers
    nawneet

  • How to check netwok whether install driver in mac 8.6

    i want to set tcp/ip. But connect via field no "Ethernet" for me to choose in TCP/IP. So, i want to check network card whether install driver.
    My mac is mac8500. The Specifications below:
    http://docs.info.apple.com/article.html?artnum=112374
    What is AAUI? What different from 10baseT and AAUI?

    When that Mac was designed, there were still big arguments going on about which cabling scheme would be most popular for users in the future. Dual Baseband coaxial cables, Single or dual Broadband Cable TV cables, and point-to-point twisted pair cables using RJ45 Jacks were all still possible options.
    AAUI is a 14-pin Ethernet Interface with the Transceiver left off. You could buy transceivers for each of the existing media listed above, to adapt it for the different cabling schemes.
    Since your Mac has a Built-in RJ45 twisted pair jack, you should use that. Since it is built-in, you should find an Extension for "Built-In Ethernet" in your System Folder > Extensions. If you do not, you may be able to re-install Mac OS, and select just to re-install the "Networking" part of the software.
    Message was edited by: Grant Bennet-Alder

  • LSO Check Booking and Prebooking

    Is there a BApi that is to be modified to validate booking or prebooking personnel when you've created a new prerequisite (object type C) for course type in LSO?  Or, is this a configuration change only?  We've created the relationship and the intotype is correct, however, when you test the action the system is not checking for the prerequisite and issuing an error.

    Hi James,
    You have not mentioned, which portal you are using. Please see below, that there are differences in the learning and the admin portal:
    Learning Portal:
    The framework of the existing design of the Learning Portal does not
    allow customer specific error messages to be displayed in the portal.
    Only a generic message will be displayed when prebooking in the learning
    portal if the BADI LSO_CHECK_BOOKING returns an error. The design of the
    application does not expect to raise an exception from the BADI. If the
    BADI processing is assumed to be unsuccessful, the messages filled by
    the BADI will be ignored and a general error message will be displayed
    in the portal.
    So this is basically a design limitation.
    Administrator Portal:
    Have you tried e.g. the following notes?
    SAP Note 1806593 Admin Portal: Message is not displayed while prebooking
    SAP Note 1575238 LSO: BADI LSO_CHECK_BOOKING does not show warning messages
    Regards,
    Agnes

  • Java script in HTMLDB to check if file exists in Unix file system

    How do I use javascript to check if file is exists in Unix file system. I would like to dispaly the columns only if file is exists.

    Hello,
    This is one of those features that the manuals do not cover.
    How to use and build AJAX features could be a whole book all by itself, and it's not really HTML DB specific feature even though we have built some hooks in application and javascript to make it easier.
    Take a look at this thread
    Netflix: Nice UI ideas
    and I've built some examples here
    http://htmldb.oracle.com/pls/otn/f?p=11933:11
    Or just search the forums for AJAX or XMLHTTP
    Carl

  • Check object property existance

    Hi,
    i need to check if a certain property of a custom object exists. Evidently, when i check with
    if ( $obj.myprop)  {...}
    its false whether the property does
    not exist at all, or the property exist but just has not been assigned a value yet.
    E.g.:
    $test = New-Object Psobject -Property @{ Testprop = "" }
    if ($test.testprop ) {"true"}
    else { "false" }
    The result is false although the property exist and could be assigned a value.
    So how do i check if the property exists at all?
    I could maybe try to assign a value and catch the error if the property isnt there, but there has to be a clean way...
    Thanks, hill
    http://www.administrator.de/

    if
    ($test.PSObject.Properties.Match('Testprop').Count)
    "true"
    else
    "false"

Maybe you are looking for

  • Jabber and windows 8

    I have jabber running on a windows 8 machine. I can't get deskphone video to work. Also when using a wireless usb headset my voice will not work. The voice will work if I use wired headset. Does anyone know when windows 8 will be supported, or when a

  • Can i use home sharing when two different apple accounts are on the same computer?

    will home sharing work when two iTunes Libraries are on the same computer?

  • Can anyone save my external hard drive?

    Hi all, This is probably the first time ever that I have to ask a question myself. Usually when I have any problems I can find a solution in other people's solved threads. But not this time and I'm really frustrated. If any of you can help me with th

  • Cabling from MacBook 2 Vizio HDTV

    Is there a cable that can connect my MacBook to HDTV (have two, Vizio/Samsung) in order to watch movies currently residing on laptop?

  • Mac Pro as Apple TV?

    I'm looking to buy a new Mac Pro soon and wondering the best way to use it for movie/TV/sound system too. Can I use the Pro to serve as an "Apple TV" with cable to another room for viewing on a plasma TV (Samsung 1080 50" maybe)? Also is DSL good eno