Sample JSP code needed with jdbc select lists

Hello java experts!
I need to create a series a jsp pages that connects to an ms access "books" database. This first page should connect to the books.mdb and populate select lists with the values from the database. The solution would be similar to the the books shopping cart in the CoreServlets book, EXCEPT I must do everything in JSP only.
All I have done to this point is Java servlets. (I've done shopping cart stud in ASP.net, but not JSP).
I know everyone hates to post code samples, but seeing the code will help me understand. I've read the API, the tutorials, 3 textbooks, and any other doc I could find. I understand Java beans and jsp, but I need to see the JSP for this to finally crystalize.
Thanks in advance.
-JavaGirl

what school is teaching db access from jsp?

Similar Messages

  • SSO Sample JSP Code

    Hi,
    Is there anyone here who can help or much appreciated if you can provide a sample JSP code for SSO (Single Sign On pages) of Login, Logoff and Change Password. I'll be needing this to customize/replace our SSO to pattern with our current look and feel of our website. Many thanks.
    Russel

    I'm using 9iAS and 10g. either of the two versions will do. Thanks!
    Russel

  • Associating a process with a 'select list with submit'

    Hi,
    In a tabular form I have 2 'select list with submit'. If a row is selected in the tabular form I need the following functionality from each of the select lists:
    Once a value is selected from the list a process will get excuted which will update a column of the checked row in the database table with the selected value from the list.
    My question is,
    1. How can I associate an 'after submit process' with the 'select list with submit'?
    2. Can I store the selected value in a variable which I can pass as an input parameter to a PL/SQL body?
    Regards,
    AM

    Hi,
    Please see my requirement below.
    I have a 'select list with submit' say P1_Select in a Tabular form Page. I want to create an after submit process (PL/SQL Process) which will take the selected value from the select list as input parameter and perform an update function for the checked row with that value.
    I'm trying give a feel the procedure:
    CREATE OR REPLACE procedure "P_REJECT"
    (p_message IN VARCHAR2 default Null)
    is
    begin
    FOR ii IN 1 .. APEX_APPLICATION.G_F01.count
    LOOP
    UPDATE NI SET NI.STATUS_NI = 'WCONF', NI.NI_Message = p_MESSAGE
    WHERE NI.NI_REF = APEX_APPLICATION.G_F01(APEX_APPLICATION.G_F01(ii));
    END LOOP;
    end;
    As suggested by Flavio I created the conditional 'after submit' process where I'm making a call to the above procedure.
    1. I am not sure how to pass the selected value as a parameter to the proc.
    2. 'request = value, where the value is the string literal P1_SELECT'.... Could not really figure out the meaning of string literal P1_SELECT
    Regards,
    AM

  • How to write a javascript function on a report column with type select list

    I have a report with a select list column:
    HTMLDB_ITEM.SELECT_LIST_FROM_LOV(22, "tablename"."PRIMARY", 'PRIMARY').
    The value of primary can be null, yes, no. I want to write a javascript to achieve this: once the user changes one primary value to be yes, others with 'yes' will be changed to 'no' automatically.
    Could somebody help me on this.
    Thanks.
    Jen

    Thanks Patrick for your quick reply.
    I created a dynamic action with the following steps, but the dynamic action is not taking place.
    Event: After Refresh
    Selection Type: Region
    Region: Report 1 (my report name)
    Then in the true action
    Action: Execute Javascript SCode
    Code: showHighlight();
    I even tried to get an alert, but the dynamic action is not done at all. It seems the After refresh dynamic action is not working for a region.

  • Need Help on Select list using AJAX

    Hi ,
    I have a 3 select list in the application,
    2nd select list depends on 1st, 3rd depends on 1st and 2nd.
    I have created application items and process and java script, but for some reason i can not pass 2 application items values to the process.
    Please any idea or example. I have followed dennis site for creating cascade select demo application.
    Thanks
    KP

    Did you have a look at this thread:
    Problem with Dynamic Select Lists
    Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://www.opal-consulting.de/training
    http://apex.oracle.com/pls/otn/f?p=31517:1
    -------------------------------------------------------------------

  • Need help with Hierarchical Select List

    I'm trying to left-pad the entries in a select list to indicate organizational hierarchy. Here's the query:
    SELECT
    LPAD(' ',2*(LEVEL-1)) || ORG_NM d,
    ORG_ID r
    FROM
    ORG_ENTITIES
    START WITH ORG_ID = 901
    CONNECT BY PRIOR ORG_ID = MNG_ORG_ID
    ORDER BY 2;
    (there are two spaces between the single quotes)
    It seems to work fine from a standard SQL prompt, but it looks as if either Apex or the browser is stripping off the spaces in the padding. Can someone point out a reason? I'm using Application Express 3.0.0.00.20. Thanks.

    I've used the concatenation of two items to create space between them before, and that works fine. This is an LPAD situation, however, as there is only one item.
    I did try the & nbsp; in place of the literal space character. The select list strips out the & and I get some variation of the literal characters. I even tried using periods in place of spaces for the padding and that didn't work either.
    Don't know what is going on.

  • Help needed with JDBC - please help! (newbie)

    hi all
    i m new to jdbc
    i have installed MySQL server on my winxp machine
    i used the command:
    mysql -p -u root
    Enter password: ****now when writing a prog i m getting a prob at this piece of code:
    Connection con=DriverManager.getConnection("jdbc:odbc:books","root","root");wot is wrong wid this code?
    please help......
    thanks in advance

    There are about 20 different things that could be wrong a this point; I'm not going to list them all. If you want specific help, you need to post specific information. This is usually done by posting either a stack trace from an exception, or a more complete section of code and a description of the problem and ALL the symptoms. You have all the information on what you've done, we have none of it.
    Instead of trying to diagnose whats wrong with your ODBC setup, I'm going to give you some strong advice; don't use ODBC with JDBC if you can avoid it, and with MySQL you can avoid it. It makes things simpler, less can go wrong, and you don't have to configure a DSN on every machine that you install the program on.
    To use "pure" JDBC without ODBC for MySQl:
    1) download the JDBC driver (you might already have this)
    http://dev.mysql.com/downloads/connector/j/3.1.html
    2) follow the installation instructions
    http://dev.mysql.com/doc/refman/5.0/en/java-connector.html
    In particular, make sure your classpath is set correctly
    3) Here's an example of loading the driver and establishing a connection
    http://dev.mysql.com/doc/refman/5.0/en/cj-connect-with-drivermanager.html
    Note the form of the connection URL,
    "jdbc:mysql://localhost/test?user=monty&password=greatsqldb"
    This is what an URL without ODBC looks like; there is no DSN, which means no DSN has to be configured.
    4) The MySQL database has some built-in security, to prevent malicious connections from outside computers. Solutions to that and other common problems are here:
    http://dev.mysql.com/doc/refman/5.0/en/cj-faq.html

  • Help with Cascading Select List in Tabular Form

    Hello Friends,
    I am trying to implement Denes Kubicek's sample for Cascading Select list and ran into this error:
    Please help me identify what I might have missed ???
    <code>
    The XML page cannot be displayed
    Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later.
    Only one top level element is allowed in an XML document. Error processing resource 'http://apex.oracle.com/pls/apex/f?p=12...
    <select><option value="0">- Select Employee (0) -</option></select><html lang="en-us" xmlns:htmld...
    </code>
    Please find below the list of activities I performed:
    1.Created the region source
    2.Created the hidden items
    3.Created the buttons and items
    4.Created the application process for MRU and Delete
    5.Created the Application item [ TAB_CASCADING_ITEM]
    6.Created the Application Process[tab_casc_sel_list]
    Any clue/pointers to debug this are welcome.
    I tried the above on apex.oracle.com; WS: CHAITANYAPATCHIPULUSU; USERNAME :[email protected]
    PWD:Satya123 in APPLICATION : 12855 and Page :35
    Regards..

    OK, you didn't have the background process as an on demand process.
    In the MRU and MRD process, you were referencing the wrong variables for the count. (as in deb's case, it's p176, but in your case its p35).
    In the javascript function, the call that is supposed to assign : TAB_CASCADING_ITEM a value, isn't working (I believe).

  • How to set "Display as Text" field with AJAX select list

    thanks Denes for your posting. I'm trying to use the Denes Kubicek code to populate a "Display as Text" field. It works for Text Field (disabled), but not "Display as Text" field(saves state) . In my applciation I need to show this field only (not the disabled text box) when a select list value is changed. any ideas to modify the code below are appreciated.
    http://htmldb.oracle.com/pls/otn/f?p=31517:80:3418128396960418::NO
    here is the code from the url above
    1. Create an Application Process - getDet:
    DECLARE
    my_det VARCHAR2 (200);
    BEGIN
    SELECT ename || CHR(10) || job || CHR(10) || mgr
    INTO my_det
    FROM emp
    WHERE empno = :P80_EMPLOYEES;
    HTP.prn (my_det);
    END;
    2. Put the following in the Region Header of your page:
    <script language="JavaScript" type="text/javascript">
    function f_getDet ()
    var get = new htmldb_Get(null,&APP_ID.,'APPLICATION_PROCESS=getDet',0);
    get.add('P80_EMPLOYEES',html_GetElement('P80_EMPLOYEES').value)
    gReturn = get.get();
    if(gReturn)
    {  html_GetElement('P80_DETAILS').value = gReturn  }
    else
    {  html_GetElement('P80_DETAILS').value = 'null'  }
    get = null;
    </script>
    3. Put the following in the HTML Form Element Attributes of :P80_EMPLOYEES:
    onChange="f_getDet()";

    Arie,
    this works fine on normal page, except page zero. I have the AJAX select list and "Display as Text" field on page zero. The "Display as Text" field doesn't show the the value when AJAX select is changed. I'm using similar code as used in my other APEX page on OTN site. I tired to display the gReturn value, just before calling "setDisplayOnlyNode" function in the code below and it's showing correct value, but fails to display the value in the APEX field on page zero. Any ideas are appreciated.
    Thanks,
    Surya
    <script language="JavaScript" type="text/javascript">
    function setDisplayOnlyNode(pItem, pValue)
    { var textNode = pItem + '_DISPLAY'; $x(textNode).innerText = pValue; }
    function f_getDet ()
    var get = new htmldb_Get(null,&APP_ID.,'APPLICATION_PROCESS=getDet',0);
    get.add('P1_EMPLOYEES',html_GetElement('P1_EMPLOYEES').value)
    gReturn = get.get();
    if(gReturn)
    { setDisplayOnlyNode('P1_DETAILS',gReturn)}
    {  html_GetElement('P1_TEST').value = gReturn  }
    get = null;
    </script>

  • Problems with customizing select lists and popup LOVs

    Hi
    I have 2 problems about select lists and popup LOVs.
    The first one is about a select list in a tabular form.
    It should be created with APEX_ITEM.SELECT_LIST_FROM_LOV or similar and take its values from a named LOV.
    This worked fine but now it should also have the possibility to enter a free value.
    I tried to accomplish that by creating a APEX_ITEM.POPUP_FROM_LOV, but there is a problem with the function that is called by the arrow icon right to the input field (for eg. genList_f11_5()).
    If the row is added by addRow, then it works fine, but if the row is is not empty
    then the function call is like genList_f11_$_row() and the input field gets no value, when a LOV option is selected.
    The other problem is about a select list which should have the possibility to enter a custom value and
    also there should be the possibility to select several values. I tried to implement this by a text area containing the selected values and a multiple select list, with an event handler in each option. The user could click options and they would be copied to the text area. The problem is that I couldn't make the event handler work in IE.
    I would appreciate any ideas about either of these problems.
    Tiina

    Hi,
    If you download application you can see source.
    I have not write any instructions, sorry.
    If you are on Apex 4 you can just load jQuery UI autocomplete library and take ideas from my app.
    If you download my sample in zip there is uncompressed htmldbQuery library.
    You can see that and take only function htmldbAutocomplete.
    Then check jQuery UI document
    http://jqueryui.com/demos/autocomplete/#method-search
    There is method search that you can use open list just by click of input.
    I hope this helps at start.
    Regards,
    Jari

  • Ajax code help for conditional select list.

    Hi,
    I am using AJAX code for the first time, I dont have knowledge in java, I just grabbed the code from this forum and trying to manipulate to my requirement.
    My Requirement is I have two select lists, 1) host_name and 2) database_name.
    As soon as I pick/choose the value in host_name select list, I need to populate only those databases on that particular host. I dont want to submit the page for this action.
    Here is the code, I appreciate if some one can help.
    On demand Application Process code:
    declare
    l_counter number;
    l_o_name varchar2(2000);
    begin
    owa_util.mime_header('text/xml', FALSE );
    htp.p('Cache-Control: no-cache');
    htp.p('Pragma: no-cache');
    owa_util.http_header_close;
    htp.prn('<select>');
    for rec in (select "ORA_DATABASES_VW"."DATABASE_NAME" as "DATABASE_NAME",
         "ORA_DATABASES_VW"."DB_ID" as "DB_ID"
    from "ORA_DATABASES_VW"
    where "ORA_DATABASES_VW"."HOST_NAME" = :TEMP_ITEM)
    loop
    htp.prn('<option value="' || rec.db_id || '">' || rec.database_name || '</option>');
    end loop;
    htp.prn('</select>');
    end;
    HTML Header on that page:
    =================
    <script language="JavaScript1.1" type="text/javascript">
    function get_List_XML (source_item,target_item){   
    var v_Target = html_GetElement(target_item);
    var v_Source = html_GetElement(source_item);
    var ajaxResult = new htmldb_Get(null,&APP_ID.,'APPLICATION_PROCESS=POPULATE_LIST_XML',0);
    ajaxResult.add('TEMP_ITEM',source_item.value);
    var v_result_xml = ajaxResult.get('XML');
    if(v_result_xml && v_Target)
    var options_Contents = v_result_xml.getElementsByTagName("option");
    v_Count = options_Contents.length;
    v_Target.length = 0;
    for(var i=0;i<v_Count;i++)
    var v_opt_xml = v_result_xml.getElementsByTagName("option");
    appendToSelect(v_Target, v_opt_xml.getAttribute ('value'),v_opt_xml.firstChild.nodeValue)
    function appendToSelect(target_item, option_val, option_content) {  
    var v_Opt = document.createElement("option");
    v_Opt.option_value = option_val;
    if(document.all){
    target_item.options.add(v_Opt);
    v_Opt.innerText = option_content;
    }else{  
    v_Opt.appendChild(document.createTextNode(option_content));
    target_item.appendChild(v_Opt);
    </script>
    Form element attribute in the host_name column. P935_INSTANCE_DB_NAME is my page item for database_name.
    onchange="get_List_XML (this,'P935_INSTANCE_DB_NAME')"

    Here is the code, Hope I had put it correctly now.
    This is fixed now. Thanks a lot for helping out this. I have two questions.
    1) I am seeing very slowness when selecting the select list. Will these java code require much resource?
    2) I need to put this logic in many screens for many columns. So having these many application process and application items and java code, will the application performance get a hit? I know that application process are on-demand and get called only when required.
    declare
    l_counter number;
    l_o_name varchar2(2000);
    begin
    owa_util.mime_header('text/xml', FALSE );
    htp.p('Cache-Control: no-cache');
    htp.p('Pragma: no-cache');
    owa_util.http_header_close;
    htp.prn('<select>');
    for rec in (select "ORA_DATABASES_VW"."DATABASE_NAME" as "DATABASE_NAME",
    "ORA_DATABASES_VW"."DB_ID" as "DB_ID"
    from "ORA_DATABASES_VW"
    where "ORA_DATABASES_VW"."HOST_NAME" = :TEMP_ITEM)
    loop
    htp.prn('<option value="' || rec.db_id || '">' || rec.database_name || '</option>');
    end loop;
    htp.prn('</select>');
    end;
    HTML Header on that page:
    =================
    <script language="JavaScript1.1" type="text/javascript">
    function get_List_XML (source_item,target_item){
    var v_Target = html_GetElement(target_item);
    var v_Source = html_GetElement(source_item);
    var ajaxResult = new htmldb_Get(null,&APP_ID.,'APPLICATION_PROCESS=POPULATE_LIST_XML',0);
    ajaxResult.add('TEMP_ITEM',source_item.value);
    var v_result_xml = ajaxResult.get('XML');
    if(v_result_xml && v_Target)
    var options_Contents = v_result_xml.getElementsByTagName("option");
    v_Count = options_Contents.length;
    v_Target.length = 0;
    for(var i=0;i<v_Count;i++)
    var v_opt_xml = v_result_xml.getElementsByTagName("option");
    appendToSelect(v_Target, v_opt_xml.getAttribute ('value'),v_opt_xml.firstChild.nodeValue)
    function appendToSelect(target_item, option_val, option_content) {
    var v_Opt = document.createElement("option");
    v_Opt.option_value = option_val;
    if(document.all){
    target_item.options.add(v_Opt);
    v_Opt.innerText = option_content;
    }else{
    v_Opt.appendChild(document.createTextNode(option_content));
    target_item.appendChild(v_Opt);
    </script>
    Form element attribute in the host_name column. P935_INSTANCE_DB_NAME is my page item for database_name.
    onchange="get_List_XML (this,'P935_INSTANCE_DB_NAME')"
    }

  • Upgrade to 10.1.3.4: Problems with multi-select list

    Hi,
    We upgraded from BiseSEone (10.1.3.2) to 10.1.3.4 (using BI EE). One of the features we were longing for was the improved multi-select list in the dashboard prompts (with a efficient search support). But after the Installation the multi-select list doesn't work at all. There are no data offered and the frames are missing. What could be go wrong here ? There were no problems during the installation. I told the installation to keep the configurations.
    regards
    Thomas
    Hi guru's,
    is there anybody around who experienced a similar phenomenon !!!
    regards
    Thomas
    Edited by: tdombrow10 on Jun 7, 2009 10:04 PM

    unfortuantely(i beleive i had the same problem)
    you have to rebuild them
    i hope i helped....
    http://greekoraclebi.blogspot.com/
    ///////////////////////////////////////

  • How work with tow select list

    Dear All
    i have tow  select list item
    first one is country
    and the second one is city
    how can i get all city for selected country?
    please help

    Hi,
    The simplest way
    a. Make Country a select list with submit.
    b. Make City a slect list based on query and in the query add the condition
    and country = :P1_country -- where p1_country is the item in step a abovec. Make City conditional by adding a condition on the item of the type Value of Item in expression 1 is not null, and in expression 1 enter p1_country.
    This way when the user lands on the page only Country will display. Once cuntry has been selected the page will submit and now the City item will be displayed with the values returned by its query.
    Regards,

  • Change from 4.5 to 5,1 with multiple select list boxes

    Had a multiple select list box which worked fine in 4.5 i.e
              a comma seperated list would be passed to the corresponding set method
              in the bean. We switch to 5.1 and this no longer works any one know of
              the solution or a work around to the problem
              Hugh McBride
              [email protected]
              

    Vladimir,
              I am using a JSP/Java Beans design where the name of the
              set
              method in the bean match the name of the ui component so when the form
              is submitted the method in the bean is automatically called. The method
              request is a workaround but one we wanted to avoid using
              Thanks
              Hugh McBride
              [email protected]
              Vladimir Andral wrote:
              > How are you getting the values? request.getParameter()?
              >
              > You should be using request.getParameterValues() if the parameter
              > has more than one value.
              >
              > Check out the documentation for the HttpServletRequest interface.
              >
              > --
              > Vlad
              >
              > Hugh McBride wrote in message <[email protected]>...
              > >Had a multiple select list box which worked fine in 4.5 i.e
              > >a comma seperated list would be passed to the corresponding set method
              > >in the bean. We switch to 5.1 and this no longer works any one know of
              > >the solution or a work around to the problem
              > >
              > >
              > >Hugh McBride
              > >[email protected]
              > >
              

  • Problem with cascading select lists

    Hi All,
    I have two select lists on a form, category and sub category. When I select the category the sub-category list gets populated and a report is displayed. When I select the sub-category the report listing re-displays limited by sub-category. Works fine.
    However, when I go back and select another category, the report returns no data on the first attempt. In debug mode I note that although visually the sub-category has been reset, the session value has not, and so the report is selecting on an invalid combination of category and sub-category.
    How do I get the sub-category to reset when the category changes?
    I have tried an onChange javascript entry on the form attribute but it does not work since APEX inserts its own onChange before my one.
    Suggestions please...thanks in advance.
    Sajit

    Hi,
    can you setup an example on apex.oracle.com which fails so that we can have a look.
    Or you can use Firebug for Firefox and have a look what is sent to the server and what the response it. Check the "Console" tab. I suspect you will see an error when you trigger the refresh.
    Regards
    Patrick
    My Blog: http://www.inside-oracle-apex.com
    APEX Plug-Ins: http://apex.oracle.com/plugins
    Twitter: http://www.twitter.com/patrickwolf

Maybe you are looking for

  • Macbook (C2D) + D-Link DIR-655:  Slow wireless N speed

    When I transfer a large file (around 1.3 GB), the speed fluctuates between 1.5 MB/s (12 Mbits/s) and 2.5 MB/s (20 Mbits/s). The Macbook according the Network Utility is connected at 130 Mbit/s. It's supposed to be at 300 Mbit/s. That's one problem. T

  • Travel Request Status

    Hi Experts, Please let me know in which table travel request status is stored.settlemet status like "TO BE Settled" "Settled" Trvael stsus like "Request Recorded" "Request approved" "Trip approved" etc. Thanks and Regards Shilpashree Edited by: shilp

  • Can we restrict the partially confirmed production order from getting delet

    Dear all, Can we restrict the partially confirmed production order from getting deleted? I.e. if the production order is having status PCNF then the deletion flag indicator (status DLFL) should not be allowed to set SmanS Edited by: SAP PP Consultant

  • After deleting Win at partition 3, there is still Windows option at startup

    I bought an SSD, and hooked it with my old hdd to my system. There was a Mac and Win partition in my older drive. I erased system files, but couldn't formatted it because it has important info. Now at startup, i managed to erase second Mac option and

  • Itunes locks up if i try to import a cd

    Since the upgrade if i try to load a new cd into my itunes library, itunes locks up and locks up the pc  (winxp) Anyone have a fix ??