How to display checkbox that retrieve value from database?

Hi,
I have a problem, hope someone will help me.
The problem is, I have 3 checkbox where contain different values.
I will insert the values to db in array. When I retrieve the values, I got a problem to display it.
Let say,my checkbox's value is:
1.car
2.bus
3.lorry
when I checked car and lorry, my array will be [car,bus] insert to db.
For editing purpose, I need to display the checkbox again with the values from db. So, it should be :
1.car (checked)
2.bus (checked)
3.lorry (unchecked)
I can display the car and bus (checked) , but not the unchecked checkbox. Sometimes, it's repeating, car (checked) and car (unchecked) will display.
Anybody have a suggestion?
My codes:
String[] list = {"car","bus","lorry"};
String[] logtype ={"car","bus"}//retrieve from db (example)
for (int i=0;i<logtype.length;i++){
if (logtype.equals(list[i]){
<input type="checkbox" name="type" value="<%=list[i]%>" checked>
else{
<input type="checkbox" name="type" value="<%=list[i]%>" >

hey u can solve this problem by using vector instead of array
here's the code
<%
Vector list=new Vector();
list.addElement("car");
list.addElement("bus");
list.addElement("lorry");
Vector logtype=new Vector();
logtype.addElement("car");
logtype.addElement("bus");
for(int i=0;i<list.size();i++)
     if(logtype.contains(list.elementAt(i)))
     { %>
          <%=list.elementAt(i)%><input type="checkbox" name="type" value="<%=list.elementAt(i)%>" checked>
     <%}
     else
     {%>
          <%=list.elementAt(i)%><input type="checkbox" name="type" value="<%=list.elementAt(i)%>" >
     <%}
%>

Similar Messages

  • Retrieving values from Database in Excel Task Pane App

    So far,
    I created a website with a database on Azure, I then published my App to Azure. My problem is that I'm not sure how I retrieve values from the database (in SQL: SELECT * FROM EXAMPLE_TABLE WHERE date = str). If someone could provide me with sample code,
    that would be amazing! :D
    It would also be very helpful if anyone knew a method to automatically update the database using information from a xml stream on another website, once a day.
    Thank you!

    Hi,
    >> My problem is that I'm not sure how I retrieve values from the database
    You can use jquery ajax call to call your webserivce or REST API, which will query the database and return a json result.
    Sample:
    Apps for Office: Create a web service using the ASP.NET Web API
    >> It would also be very helpful if anyone knew a method to automatically update the database using information from a xml stream on another website
    For the database sync-up question, I suggest you posting them on the forums like SQL Server Forum.
    Thanks for your understanding.
    Best Regards
    Lan
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • How can i get the random values from database?

    Hi,
    i want to get random values from database.
    I try my best find no solution
    plz give solution in either sql query or java method.
    thanks in advance.

    try this:
    Give a numeric row-id to each row of database.
    say (1-100) for 100 rows
    In the program use random function to get random number between 0 and 1. this value u multiply with 100(or total number of rows) and take integer value of it . u then perform sql query to select the a row which matches randomly genarated value with row-id assigned to each row of database
    madhu

  • How to fill bean area with values from database

    i have a bean area in form which act as acombobox autocomplete , i want to fill it with dynamic values from database , any help will be appreciated.
    http://forms.pjc.bean.over-blog.com/article-16369664.html "this is the example i'm working on"
    Best Regards.

    An example with the EMP table:
    DECLARE
      cursor cur is select empno,ename from emp;
    BEGIN
      -- initialise the ComboBox twin values --
      for c in cur loop
       if c.empno is not null then
        Set_Custom_Property('BL.BEAN',1,'ADD_TWIN',c.empno||','||c.ename);
       else
        Set_Custom_Property('BL.BEAN',1,'ADD_TWIN_NULL',c.empno||','||c.ename);
       end if ;
      end loop;
      Set_Custom_Property('BL.BEAN',1,'ADD_TWIN','[END_DATA]');
      Set_Custom_Property('BL.BEAN',1,'SET_ALIGNMENT','right');
    END;Francois

  • Retriev values from database and display in a ComboBox

    hi all,
    i think the subject explains it all. how? currently iam using vectors which is giving me lots of problems and errors, whenever it adds to the combobox it adds the square braces as well example if the value in database is asrar then it will display [asrar], what is causing that? does anybody now any easier way??
    asrar

    please can someone help me
    asrar

  • Retrieve values from database

    Hi,
    one of the search form contains the select option for country , state and
    distributor type.
    the country drop down has 2 values - US and canada
    the conditions needed to be satisfied are :
    (1) if the country selected is US - then the states dropdown should only show the states that are associated with US in the table in the database(TABLE name is - "distributors")
    and if country selected is Canada - then should show states in canada only
    (2) if canada is selected in the country dropdown, the distributor type which has 2 values - stationary and automotive - should show only the stationary in the dropdown and not show the automotive
    This is done with the LocateQueryServlet.java...can someone please tell me how this needs to be updates so that the above conditions are satisfied...
    Attaching the code from LocateQueryServlet.java and the prolog.sql
    --------------------------------------------------------------------------------------------------LocateQueryServlet.java
    package com.dupont.refrigerants.distributorlocator;
    import java.io.IOException;
    import java.io.PrintWriter;
    import java.util.Iterator;
    import java.util.List;
    import javax.ejb.CreateException;
    import javax.naming.NamingException;
    import javax.servlet.ServletConfig;
    import javax.servlet.ServletException;
    import javax.servlet.http.HttpServlet;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    import com.proxicom.util.MiscEJBFunctions;
    * This servlet displays a query form for locating distributors. It relies on
    * the 'countries', 'states' and 'types' tables in the database to fill its
    * forms. If a table is empty, it doesn't display the corresponding select
    * (pulldown) widget. This only displays the form fragment of HTML, and should
    * be included in a complete page, probably with JSP or the like.
    * XXX Currently, the form is populated when the servlet is initialized, which
    * is a hack because I don't remember the appropriate j2ee idiom.
    * @web.servlet name="queryServlet" display-name="Distributor Locator Query
    * Servlet" description="Servlet that gets a query form for finding
    * distributors in a given region"
    * @web.servlet-mapping url-pattern="/queryServlet"
    public class LocateQueryServlet extends HttpServlet {
         * Abstract class for converting a java object into
         * an option element for an HTML select form widget.
         private abstract static class Object2Option {
              * Gets the default option at the top of the select.
              * To have no default, override this to return the
              * empty string.
              * @return <code>>option selected='true' value=''<-- Select One -->/option<</code>
              public String getDefault() {
                   return "<option selected='true' value=''>-- Select One --</option>";
              * The option element that represents the given info object.
              * @param o the info object
              * @return an unselected HTML option element.
              abstract public String getOptionFor(Object o);
              * Helper method for generating a select option element
              * with the given un-encoded value and text.
              * @param value
              * unencoded string to be passed as the form
              * value when selected
              * @param text
              * unencoded string to be displayed in the select
              * box pulldown
              * @return the concatenated and appropriately escaped
              * option element
              protected static String getOptionWith(String value, String text) {
                   return "<option value='" + Utilities.webify(value, false) + "'>"
                             + Utilities.webify(text, false) + "</option>";
         * Function object for generating 'Country' select box items.
         private static class Object2CountryOption extends Object2Option {
              * Converts a CountryInformation object into an appropriate
              * HTML option element.
              public String getOptionFor(Object o) {
                   CountryInformation c = (CountryInformation) o;
                   return getOptionWith(c.getCode(), c.getName());
         * Function object for generating 'Distributor Type' select box items.
         private static class Object2DistributorTypeOption extends Object2Option {
              * Converts a DistributorTypeInformation object into an appropriate
              * HTML option element.
              public String getOptionFor(Object o) {
                   DistributorTypeInformation c = (DistributorTypeInformation) o;
                   return getOptionWith(String.valueOf(c.getId()), c.getDescription());
         * Function object for generating 'State/Province' select box items.
         private static class Object2StateOption extends Object2Option {
              * Converts a StateInformation object into an appropriate
              * HTML option element.
              public String getOptionFor(Object o) {
                   StateInformation c = (StateInformation) o;
                   return getOptionWith(c.getCode(), c.getName());
         private String countries;
         private String states;
         private String types;
         * Constructs a simple locate query servlet.
         public LocateQueryServlet() {
              super();
         * Generates an HTML select form widget for the given list of values.
         * @param formName the name of the widget for the HTML name attribute
         * @param values the values to convert into a list
         * @param factory the method for converting each value into an option.
         * @return the complete 'select' element
         private String generateSelectFor(String formName, List values,
                   Object2Option factory) {
              StringBuffer sb = new StringBuffer();
              sb.append("<select name='").append(Utilities.webify(formName, false)).append("'>");
              sb.append(factory.getDefault());
              for (Iterator iter = values.iterator(); iter.hasNext();) {
                   sb.append(factory.getOptionFor(iter.next()));
              sb.append("</select>");
              return sb.toString();
         * Initializes the servlet. Actually results in some queries getting run.
         * @param config
         * @throws ServletException
         public void init(ServletConfig config) throws ServletException {
              try {
                   DistributorDBABeanHome distBean = (DistributorDBABeanHome) MiscEJBFunctions.getBeanHomeInterface(null, null, Utilities.EJB_DISTRIBUTOR_DBA_NAME);
                   DistributorDBABean dists = distBean.create();
                   this.countries = this.generateSelectFor("country", dists.getCountries(),
                             new Object2CountryOption());
                   this.states = this.generateSelectFor("state", dists.getStates(),
                             new Object2StateOption());
                   this.types = this.generateSelectFor("type", dists.getDistributorTypes(),
                             new Object2DistributorTypeOption());
              } catch (NamingException e) {
                   throw new ServletException("Lookup of "
                             + Utilities.EJB_DISTRIBUTOR_DBA_NAME + " failed", e);
              } catch (CreateException e) {
                   throw new ServletException(
                             "Error while creating distributor session bean", e);
              } catch (java.rmi.RemoteException e) {
                   throw new ServletException(
                             "Error while initializing distributor locator", e);
         * Executes the HTTP request and return the appropriate HTML form fragment.
         * @param request
         * @param response
         * @throws ServletException
         * @throws IOException
         protected void doGet(HttpServletRequest request,
                   HttpServletResponse response) throws ServletException, IOException {
              PrintWriter out = response.getWriter();
              response.setContentType("text/html");
              String action = request.getParameter("action");
              if (action == null) {
                   action = "where-to-buy-results";
              } else {
                   action = Utilities.webify(action, false);
              // Open form and table elements.
              out.println("<form id='distributorLocator' action='" + action + "' method='get'>"
                                  + "<table width='100%' border='0' cellpadding='4' cellspacing='0'>");
              // buffer row
              //out.println("<tr><td colspan='2'><hr width='65%' size='1' noshade></td></tr>");
              // 'Country' row
              out.println("<tr><td><div align='right' class='formSubHead'>Country:</div></td>"
                                  + "<td>" + this.countries + "</td></tr>");
              // 'States' row
              out.println("<tr><td><div align='right' class='formSubHead'>State/Province:</div></td>"
                                  + "<td>" + this.states + "</td></tr>");
              // 'Application' row
              out.println("<tr><td><div align='right' class='formSubHead'>Application:</div></td>");
              out.println("<td>" + this.types + "</td></tr>");
              // or row
              out.println("<tr><td><div align='right'></div></td><td><em><strong>or</strong></em></td></tr>");
              // zip code row
              out.println("<tr><td><div align='right' class='formSubHead'>Zip Code/Postal Code: </div></td>"
                                  + "<td><input id='zip' name='zip' type='text' /></td></tr>");
              // buffer row
              out.println("<tr><td colspan='2'><hr width='65%' size='1' noshade></td></tr>");
              // submit row
              out.println("<tr><td> </td><td><input type='submit' value='Find' /></td></tr>");
              // end table and form
              out.println("</table></form>");
    prolog.sql
    SET DEFINE OFF;
    CREATE SEQUENCE distributor_id_seq START WITH 1 INCREMENT BY 1 NOMAXVALUE;
    CREATE TABLE countries (code CHAR(2), name VARCHAR(254),
         CONSTRAINT country_pk PRIMARY KEY(code));
    CREATE TABLE states (code CHAR(5), name VARCHAR(254), country CHAR(2),
         CONSTRAINT state_pk PRIMARY KEY(code),
         CONSTRAINT fk_country FOREIGN KEY(country) REFERENCES countries(code));
    CREATE TABLE distributorTypes (id INTEGER, name VARCHAR(254),
         CONSTRAINT distributorType_pk PRIMARY KEY(id));
    CREATE TABLE distributors
         (id INTEGER,
         name VARCHAR(254),
         zip VARCHAR(12),
         country CHAR(2),
         state CHAR(5),
         city VARCHAR(63),
         address1 VARCHAR(254),
         address2 VARCHAR(254),
         fax VARCHAR(32),
         phone VARCHAR(32),
         managers VARCHAR(254),
         type INTEGER,
         email VARCHAR(254),
         url VARCHAR(254),
         CONSTRAINT distributor_pk PRIMARY KEY(id),
         CONSTRAINT fk_dist_country FOREIGN KEY(country) REFERENCES countries(code),
         CONSTRAINT fk_dist_state FOREIGN KEY(state) REFERENCES states(code),
         CONSTRAINT fk_dist_type FOREIGN KEY(type) REFERENCES distributorTypes(id));
    CREATE TABLE statesApply (state CHAR(5), distributor INTEGER,
         CONSTRAINT fk_apply_state FOREIGN KEY(state) REFERENCES states(code),
         CONSTRAINT fk_apply_distributor FOREIGN KEY(distributor) REFERENCES distributors(id));
    INSERT INTO
              distributorTypes (id, name) VALUES (1, 'Air Conditioning - Stationary and Refrigeration');
    INSERT INTO
              distributorTypes (id, name) VALUES (2, 'Air Conditioning - Automotive');
    INSERT INTO
              countries (code, name) VALUES ('CA', 'Canada');
    INSERT INTO
              countries (code, name) VALUES ('US', 'United States of America');
    INSERT INTO
              states (country, code, name) VALUES ('US', 'US_AL', 'Alabama');
    INSERT INTO
              states (country, code, name) VALUES ('US', 'US_KS', 'Kansas');
    INSERT INTO
              states (country, code, name) VALUES ('US', 'US_ND', 'North Dakota');
    INSERT INTO
              states (country, code, name) VALUES ('US', 'US_AK', 'Alaska');
    INSERT INTO
              states (country, code, name) VALUES ('US', 'US_KY', 'Kentucky');
    INSERT INTO
              states (country, code, name) VALUES ('US', 'US_MP', 'N. Mariana Islands');
    INSERT INTO
              states (country, code, name) VALUES ('US', 'US_AS', 'American Samoa');
    INSERT INTO
              states (country, code, name) VALUES ('US', 'US_LA', 'Louisiana');
    INSERT INTO
              states (country, code, name) VALUES ('US', 'US_OH', 'Ohio');
    INSERT INTO
              states (country, code, name) VALUES ('US', 'US_AZ', 'Arizona');
    INSERT INTO
              states (country, code, name) VALUES ('US', 'US_ME', 'Maine');
    INSERT INTO
              states (country, code, name) VALUES ('US', 'US_OK', 'Oklahoma');
    INSERT INTO
              states (country, code, name) VALUES ('US', 'US_AR', 'Arkansas');
    INSERT INTO
              states (country, code, name) VALUES ('US', 'US_MH', 'Marshall Islands');
    INSERT INTO
              states (country, code, name) VALUES ('US', 'US_OR', 'Oregon');
    INSERT INTO
              states (country, code, name) VALUES ('US', 'US_CA', 'California');
    INSERT INTO
              states (country, code, name) VALUES ('US', 'US_MD', 'Maryland');
    INSERT INTO
              states (country, code, name) VALUES ('US', 'US_PW', 'Palau');
    INSERT INTO
              states (country, code, name) VALUES ('US', 'US_CO', 'Colorado');
    INSERT INTO
              states (country, code, name) VALUES ('US', 'US_MA', 'Massachusetts');
    INSERT INTO
              states (country, code, name) VALUES ('US', 'US_PA', 'Pennsylvania');
    INSERT INTO
              states (country, code, name) VALUES ('US', 'US_CT', 'Connecticut');
    INSERT INTO
              states (country, code, name) VALUES ('US', 'US_MI', 'Michigan');
    INSERT INTO
              states (country, code, name) VALUES ('US', 'US_PR', 'Puerto Rico');
    INSERT INTO
              states (country, code, name) VALUES ('US', 'US_DE', 'Deleware');
    INSERT INTO
              states (country, code, name) VALUES ('US', 'US_MN', 'Minnesota');
    INSERT INTO
              states (country, code, name) VALUES ('US', 'US_RI', 'Rhode Island');
    INSERT INTO
              states (country, code, name) VALUES ('US', 'US_DC', 'District of Columbia');
    INSERT INTO
              states (country, code, name) VALUES ('US', 'US_MS', 'Mississippi');
    INSERT INTO
              states (country, code, name) VALUES ('US', 'US_SC', 'South Carolina');
    INSERT INTO
              states (country, code, name) VALUES ('US', 'US_FM', 'FS Micronesia');
    INSERT INTO
              states (country, code, name) VALUES ('US', 'US_MO', 'Missouri');
    INSERT INTO
              states (country, code, name) VALUES ('US', 'US_SD', 'South Dakota');
    INSERT INTO
              states (country, code, name) VALUES ('US', 'US_FL', 'Florida');
    INSERT INTO
              states (country, code, name) VALUES ('US', 'US_MT', 'Montana');
    INSERT INTO
              states (country, code, name) VALUES ('US', 'US_TN', 'Tennessee');
    INSERT INTO
              states (country, code, name) VALUES ('US', 'US_GA', 'Georgia');
    INSERT INTO
              states (country, code, name) VALUES ('US', 'US_NE', 'Nebraska');
    INSERT INTO
              states (country, code, name) VALUES ('US', 'US_TX', 'Texas');
    INSERT INTO
              states (country, code, name) VALUES ('US', 'US_GU', 'Guam');
    INSERT INTO
              states (country, code, name) VALUES ('US', 'US_NV', 'Nevada');
    INSERT INTO
              states (country, code, name) VALUES ('US', 'US_UT', 'Utah');
    INSERT INTO
              states (country, code, name) VALUES ('US', 'US_HI', 'Hawaii');
    INSERT INTO
              states (country, code, name) VALUES ('US', 'US_NH', 'New Hampshire');
    INSERT INTO
              states (country, code, name) VALUES ('US', 'US_VT', 'Vermont');
    INSERT INTO
              states (country, code, name) VALUES ('US', 'US_ID', 'Idaho');
    INSERT INTO
              states (country, code, name) VALUES ('US', 'US_NJ', 'New Jersey');
    INSERT INTO
              states (country, code, name) VALUES ('US', 'US_VI', 'Virgin Islands');
    INSERT INTO
              states (country, code, name) VALUES ('US', 'US_IL', 'Illinois');
    INSERT INTO
              states (country, code, name) VALUES ('US', 'US_NM', 'New Mexico');
    INSERT INTO
              states (country, code, name) VALUES ('US', 'US_VA', 'Virginia');
    INSERT INTO
              states (country, code, name) VALUES ('US', 'US_IN', 'Indiana');
    INSERT INTO
              states (country, code, name) VALUES ('US', 'US_NY', 'New York');
    INSERT INTO
              states (country, code, name) VALUES ('US', 'US_WA', 'Washington');
    INSERT INTO
              states (country, code, name) VALUES ('US', 'US_IA', 'Iowa');
    INSERT INTO
              states (country, code, name) VALUES ('US', 'US_NC', 'North Carolina');
    INSERT INTO
              states (country, code, name) VALUES ('US', 'US_WV', 'West Virginia');
    INSERT INTO
              states (country, code, name) VALUES ('US', 'US_WI', 'Wisconsin');
    INSERT INTO
              states (country, code, name) VALUES ('US', 'US_WY', 'Wyoming');
    INSERT INTO
              states (country, code, name) VALUES ('CA', 'CA_AB', 'Alberta');
    INSERT INTO
              states (country, code, name) VALUES ('CA', 'CA_BC', 'British Columbia');
    INSERT INTO
              states (country, code, name) VALUES ('CA', 'CA_MB', 'Manitoba');
    INSERT INTO
              states (country, code, name) VALUES ('CA', 'CA_NB', 'New Brunswick');
    INSERT INTO
              states (country, code, name) VALUES ('CA', 'CA_NL', 'Newfoundland and Labrador');
    INSERT INTO
              states (country, code, name) VALUES ('CA', 'CA_NS', 'Nova Scotia');
    INSERT INTO
              states (country, code, name) VALUES ('CA', 'CA_NT', 'Northwest Territories');
    INSERT INTO
              states (country, code, name) VALUES ('CA', 'CA_NU', 'Nunavut');
    INSERT INTO
              states (country, code, name) VALUES ('CA', 'CA_ON', 'Ontario');
    INSERT INTO
              states (country, code, name) VALUES ('CA', 'CA_PE', 'Prince Edward Island');
    INSERT INTO
              states (country, code, name) VALUES ('CA', 'CA_QC', 'Qu�bec');
    INSERT INTO
              states (country, code, name) VALUES ('CA', 'CA_SK', 'Saskatchewan');
    INSERT INTO
              states (country, code, name) VALUES ('CA', 'CA_YT', 'Yukon');
    Any immediate help is truly appreciated.
    Thanks in advance

    I thank you for the link, it's something I've already done several times ....
    actually this code tries to manage a key incremental, I am obliged to do that because I am in MS SQL Server and therefore what works for oracle does not work for SQL Server, which is why I want to do it manual, I also posted this in a previous post and I was asked to retrieve the field value by Code: Help please : dbsequence refresh on MS sql server
    now admitting that it is not what I want to do and I have the following code:
    if (it1.getValue () == null) (
    Connection connection = ConnectionManager.getInstance (). GetConnection ();
    Statement statement = connection.createStatement ();
    ResultSet resultset = statement.executeQuery ("SELECT id FROM WHERE name = spider" it2.getValue + () + "");
    while (resultSet.next ())
    it1.setValue (resultSet.getInt (1));
    BindingContainer getBindings bindings = ();
    OperationBinding operationBinding bindings.getOperationBinding = ("Commit");
    OperationBinding.execute Object result = ();
    if (! operationBinding.getErrors (). isEmpty ()) (
    return null;
    else (
    BindingContainer bindings2 getBindings = ();
    OperationBinding operationBinding2 bindings2.getOperationBinding = ("Commit");
    OperationBinding2.execute Object result = ();
    if (! operationBinding2.getErrors (). isEmpty ()) (
    return null;
    What code ADF BC I will put in place of jdbc code

  • How to display Error Message in APEX from Database Stored Procedure

    Hello,
    Using APEX version 3.2
    DB version 9.2.0.8.0
    Internet Explorer version 6
    I have an After Submit Page Process that calls a stored procedure. In the exception section I'm using dbms_output.putline to display an error message, but the error message is not displayed in APEX. How can I have the error message generated from the stored procedure display in APEX?
    Thanks so much.

    Hi Apex_Noob,
    I created On Load - Before Header process that uses apex_application.g_notification := :P3_ROLE;I'm sorry but I'm not sure what you mean by "instead of using dbms_output.putline use :P1_ITEM"
    I have the following code in my stored procedure
    EXCEPTION
         WHEN OTHERS THEN
         dbms_output.put_line('Role does not exist');Thanks.

  • How to retrieve value from xml file

    hi all,
    can somebody pls tell me how to retrieve value from xml file using SAXParser.
    I want to retrieve value of only one tag and have to perform some validation with that value.
    it's urgent .
    pls help me out
    thnx in adv.
    ritu

    hi shanu,
    the pbm is solved, now i m able to access XXX no. in action class & i m able to validate it. The only thing which i want to know is it ok to declare static ArrayList as i have done in this code. i mean will it affect the performance or functionality of the system.
    pls have a look at the following code snippet.
    public class XMLValidator {
    static ArrayList strXXX = new ArrayList();
    public void validate(){
    factory.setValidating(true);
    parser = factory.newSAXParser();
    //all factory code is here only
    parser.parse(xmlURI, new XMLErrorHandler());     
    public void setXXX(String pstrXXX){          
    strUpn.add(pstrXXX);
    public ArrayList getXXX(){
    return strXXX;
    class XMLErrorHandler extends DefaultHandler {
    String tagName = "";
    String tagValue = "";
    String applicationRefNo = "";
    String XXXValue ="";
    String XXXNo = "";          
    XMLValidator objXmlValidator = new XMLValidator();
    public void startElement(String uri, String name, String qName, Attributes atts) {
    tagName = qName;
    public void characters(char ch[], int start, int length) {
    if ("Reference".equals(tagName)) {
    tagValue = new String(ch, start, length).trim();
    if (tagValue.length() > 0) {
    RefNo = new String(ch, start, length);
    if ("XXX".equals(tagName)) {
    XXXValue = new String(ch, start, length).trim();
    if (XXXValue.length() > 0) {
    XXXNo = new String(ch, start, length);
    public void endElement(String uri, String localName, String qName) throws SAXException {                    
    if(qName.equalsIgnoreCase("XXX")) {     
    objXmlValidator.setXXX(XXXNo);
    thnx & Regards,
    ritu

  • How to retrieve value from insert statement

    hi,
    how can i get a certain value from insert statement and store it in a variable.
    suppose i am inserting emp_no , emp_name , emp_salary to employee table
    and i want to store the emp_name in a variable for other processing,
    how can i accomplish this ? i'm guessing that i have to use trigger,
    but dont know the procedure .
    any help will be greatly appreciated
    thanks

    insert into <table> valiues (....) returning <expression> into <variable>
    You could and should have found this using the SQL Language reference manual
    or
    http://www.morganslibrary.org/reference/insert.html
    Sybrand Bakker
    Senior Oracle DBA

  • How can i get the all values from the Property file to Hashtable?

    how can i get the all values from the Property file to Hashtable?
    ok,consider my property file name is pro.PROPERTIES
    and it contain
    8326=sun developer
    4306=sun java developer
    3943=java developer
    how can i get the all keys & values from the pro.PROPERTIES to hashtable
    plz help guys..............

    The Properties class is already a subclass of Hashtable. So if you have a Properties object, you already have a Hashtable. So all you need to do is the first part of that:Properties props = new Properties();
    InputStream is = new FileInputStream("tivoli.properties");
    props.load(is);

  • Retrieve values from a HTML table !!!

    Hi.
    How can i retrieve values from a HTML table using javascript ?
    I´m trying to use the command "document.getElementsByTagName" without success.
    Thanks in advance.
    Eduardo

    Hi, Deepu.
    I´m still with trouble in retrieving the value in HTML.
    In debug the C_CELL_ID seems to be correctly updated but
    when using the command "document.getElementById" the value is always "null".
    I implemented in the method DATA_CELL the code :
      if i_x = 3 and i_y = 2.
      C_CELL_ID             = 'zs'.
      C_CELL_CONTENT = 10. 
      endif.
    And in HTML :
    var ztest = document.getElementById('zs');
    alert(ztest);
    Could you help me please.
    Many regards
    Eduardo S.
    Message was edited by: Eduardo   Silberberg

  • Retrieving values from a table

    Hi all,
    I need to retrieve values from CSKS-KOSTL for values containing the pattern entered by the user. For example, if the user enters 1, need to retrieve all the KOSTL values starting with 1. But when i write a SELECT statement mentioning where kostl in '1', it is ignoring all the values like (0000001, 00001034, 0012334, and others). Only values starting with 1 is only retrieved as this is a character field and due to conversion routine, zeroes are prefixed while storing in the database.
    Could any one let me know how to retrieve the values from the database in this situation?

    If you want to use IN operator in your where clause then you should define a range variable(R_KOSTL) which refers to CSKS=KOSTL and populate the range as below
    R_KOSTL-SIGN = 'I'.
    R_KOSTL-OPTION = 'CP'.
    R_KOSTL-LOW = '1*'.
    APPEND R_KOSTL.
    and then write your select statement as .... WHERE kostl IN r_kostl.
    The approach suggested by Amit should also work fine.
    Thanks
    Kiran

  • How Can I get multi column values from dynamic search help?

    Hi Gurus;
    I'm using dynamic search help in my program.
    I want to get multi column values from search help. But I dont know solution for this issue.
    I'm using F4IF_INT_TABLE_VALUE_REQUEST FM.
    How Can I get multi column values from dynamic search help?
    Thanks.

    Believe it or not, the same FM worked for me in a dynpro. I will try to explain here how it works in custom screen and then you can do your work for other screens or program types. I am not going to write my actual work but will explain in general.
    I have 4 fields (FLD1, FLD2, FLD3, FLD4) and i made the search based on FLD2 and when user click on a line (could be any field), then this would bring the line on to the screens.
    There are like 3 steps.
    You have your value_tab for my fields FLD1, FLD2, FLD3 and FLD4. This is just the data that we pass into the FM. (data: IT_VALTAB type table of ZVAL_TABLE)
    Next map the screen fields into an internal table (data: It_dynpfld type table of dselc ). I also have other internal tables defined  (just to keep it straight, i will be putting here) data:  It_return type standard table of ddshretval.
    Next step is to call the function module. Make sure you have values in IT_VALTAB.
    call function 'F4IF_INT_TABLE_VALUE_REQUEST'
    exporting
            retfield        = 'FLD2'
            value_org       = 'S'
          tables
            value_tab       = It_VALTAB
            return_tab      = It_return
            dynpfld_mapping = It_dynpfld
          exceptions
            parameter_error = 1
            no_values_found = 2
            others          = 3.
        if sy-subrc <> 0.
          message id sy-msgid type sy-msgty number sy-msgno
          with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
        else.
          perform get_selected_fields tables It_return.
        endif.
    The code within the perform GET_SELECTED_FIELDS  - We need to map the result fields after user selects it. The code goes like this. This is step is to update the dynpro fields.
    I need a internal table as well as a work area here. like,
    data: lt_fields type table of dynpread,
            la_fields type dynpread.
      field-symbols: <fs_return> type ddshretval.
    so fill out LT_FIELDS from the IT_RETURN table
    loop at lt_return assigning <fs_return>.
        la_fields-fieldname = <fs_return>-retfield.
        la_fields-fieldvalue = <fs_return>-fieldval.
        append la_fields to lt_fields.
        clear: la_fields.
      endloop.
    Call the FM to update the dynpro
    call function 'DYNP_VALUES_UPDATE'
        exporting
          dyname               = sy-repid
          dynumb               = '1002' "This is my screen number. You could use 1000 for selection screen (hope so)
        tables
          dynpfields           = lt_fields
        exceptions
          invalid_abapworkarea = 1
          invalid_dynprofield  = 2
          invalid_dynproname   = 3
          invalid_dynpronummer = 4
          invalid_request      = 5
          no_fielddescription  = 6
          undefind_error       = 7
          others               = 8.
      if sy-subrc <> 0.
        message id sy-msgid type sy-msgty number sy-msgno
                with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      endif.
    good luck

  • WPF- How to save and retrieve details from database

    I want to develop an desktop app to save and retrieve details from database, but am having a little hitch
    am getting errors in my code, kindly advice below are the required code
    xaml
    <Grid>
            <TextBox HorizontalAlignment="Left" Height="23" Margin="144,28,0,0" TextWrapping="Wrap" x:Name="TbxId" VerticalAlignment="Top" Width="193"/>
            <TextBox HorizontalAlignment="Left" Height="23" Margin="144,134,0,0" TextWrapping="Wrap" x:Name="TbxFn" VerticalAlignment="Top" Width="193"/>
            <TextBox HorizontalAlignment="Left" Height="23" Margin="144,77,0,0" TextWrapping="Wrap" x:Name="TbxLn" VerticalAlignment="Top" Width="193"/>
            <Label Content="Student ID" HorizontalAlignment="Left" Margin="10,28,0,0" VerticalAlignment="Top" Width="101"/>
            <Label Content="Last Name" HorizontalAlignment="Left" Margin="10,134,0,0" VerticalAlignment="Top" Width="101"/>
            <Label Content="First Name" HorizontalAlignment="Left" Margin="10,77,0,0" VerticalAlignment="Top" Width="101"/>
            <Button x:Name="BtnSave" Content="Save" HorizontalAlignment="Left" Margin="23,206,0,0" VerticalAlignment="Top" Width="75" />
            <Button x:Name="BtnBrowse" Content="Browse" HorizontalAlignment="Left" Margin="149,206,0,0" VerticalAlignment="Top" Width="75" Click="Save"/>
            <Button x:Name="BtnShow" Content="Show" HorizontalAlignment="Left" Margin="294,206,0,0" VerticalAlignment="Top" Width="75"/>
            <WindowsFormsHost Grid.Column="0" Margin="448,28,75,243">
                <wf:PictureBox x:Name="pictureBox1" Height="150" Width="150" SizeMode="StretchImage"/>
            </WindowsFormsHost>
        </Grid>
    cs
    private void Browse(object sender, RoutedEventArgs e)
                SqlConnection cn = SqlConnection(global::DatabaseApp.Properties.Settings.Default.Database1ConnectionString);
                try
                    OpenFileDialog dlg = new OpenFileDialog();
                    dlg.Filter = "JPG Files (*.jpg)|*.jpg|GIF Files (*.gif)|*.gif|All Files(*.*)|*.*";
                    dlg.Title = "Select Student Picture";
                    if (dlg.ShowDialog() == DialogResult.OK)
                        imgLoc = dlg.FileName.ToString();
                        picStu.ImageLocation = imgLoc;
                catch(Exception ex)
                    System.Windows.MessageBox.Show(ex.Message);
    Thank you
    Jayjay john

    Hi Joakins,
    I think Lloyd has a point here in that all I see there which is really database related is a connection string.
    Maybe your question is more general though and you're just asking how to work with a database as a general principle.
    Personally, I like entity framework and would recommend that.
    You can read a shed load of stuff about it.
    https://msdn.microsoft.com/en-gb/data/ef.aspx?f=255&MSPPError=-2147217396
    With WPF almost every dev uses MVVM and I'm no exception.
    You may find this interesting:
    http://social.technet.microsoft.com/wiki/contents/articles/28209.wpf-entity-framework-mvvm-walk-through-1.aspx
    The article for the second in the series is only partly written, but the sample is complete:
    https://gallery.technet.microsoft.com/WPF-Entity-Framework-MVVM-78cdc204
    Hope that helps.
    Recent Technet articles: Property List Editing;
    Dynamic XAML

  • How do I update a bean value from an AJAX call?

    Hi all,
    How do I update a bean value from an AJAX call? I suppose I could write a servlet to do it. However, this seems like a common problem, so I was wondering if there was some built in solution.
    Thanks,
    Grae
    Edited by: caalip2 on Mar 30, 2010 1:07 PM

    caalip2 wrote:
    Raymond
    Basically, I would user the following. The first choice for IE, the second for Firefox.
    new ActiveXObject("Microsoft.XMLHTTP");
    new XMLHttpRequest();
    GraeDon't do this to yourself. If it were that easy there wouldn't be AJAX frameworks for JSF. Find one you like and use it. I've used a4j (part of RichFaces) successfully.

Maybe you are looking for