How to compare user input and database data?

hi, I am new to JAVA, i hope i didnt post wrong forum :P
I would like to know how to get user data input from web page(client side) and compare with the data in database (server side)?
What i doiong is using the JavaScript to get the user input and compare with the JSP. but this way it seem like not a good way! Because i facing a lot of problem to get the user input!!
Thx a lot!!
function pasteData(obj){
          var em_num_select = obj;
     //document.write(em_num_select);
          <%
            SQLSelectNO = "SELECT em_num FROM emmast ";
               try {
                    getEmpNo = db.execSQL(SQLSelectNO);
               }catch(SQLException e){
                    System.err.println("Query Error!!");
               while(getEmpNo.next()){
                    matchEmpNo = getEmpNo.getString("em_num");
                    %>if (em_num_select == '<%=matchEmpNo%>'){
                    <%
                              String SQLgetAllInfo = "SELECT em_num, em_name, em_init, "+
                                                                                     "em_buyer_flag, em_dsgn_cde, em_proj_all, "+
                                                                                     "em_proj_cde1, em_proj_cde2, em_proj_cde3 "+
                                                                                     "FROM emmast "+
                                                                                     "WHERE em_num = '"+matchEmpNo+"' ";
                              try{
                                   getAllInfo = db.execSQL(SQLgetAllInfo);
                              }catch(SQLException e){
                                   System.err.println("Query Error");
                              while(getAllInfo.next()){%>
                                   document.all.emp_name.value = '<%=getAllInfo.getString("em_num")%>'
                                   document.all.emp_init.value = '<%=getAllInfo.getString("em_name")%>'
                                   document.all.emp_disg.value = '<%=getAllInfo.getString("em_dsgn_cde")%>'
                                   document.all.emp_buyer_flg.value = "<%=getAllInfo.getString("em_buyer_flag")%>";
                                   document.all.emp_basis.value = "<%=getAllInfo.getString("em_proj_all")%>";<%System.out.println(getAllInfo.getString("em_proj_cde1"));%>
                                   document.all.emp_pro_cde1.value = "<%=getAllInfo.getString("em_proj_cde1")%>";
                                   document.all.emp_pro_cde2.value = "<%=getAllInfo.getString("em_proj_cde2")%>";
                                   document.all.emp_pro_cde3.value = "<%=getAllInfo.getString("em_proj_cde3")%>";
                         <%}%>
                         }//close if (em_num_select == '<%=matchEmpNo%>')
          <%}// close hile(getEmpNo.next())%>
     }// close function pasteData(obj)

Hi,
This forum is exclusively for Sun Java Studio Creator.
You may need to post this question at:
http://forum.java.sun.com/forum.jspa?forumID=45
Thanks,
Creator Team.

Similar Messages

  • How to take user input and place it in a variable

    All I want to know is how to copy user input from the message pop up and store in a local variable?
    Thanks.

    Hi
    Just take a look at thread's example
    http://forums.ni.com/t5/NI-TestStand/TestStand-Message-Popup/m-p/1792424/highlight/true#M35397
    The trick is done by Message-Popup PostExpression: Locals.strMyResponse = Step.Result.Response
    Hope this helps
    Juergen
    =s=i=g=n=a=t=u=r=e= Click on the Star and see what happens :-) =s=i=g=n=a=t=u=r=e=

  • How to save user name and system date in a table

    I have a form that allow users to enter some information...
    I want to save user name in one of the columns and system date in another column by default when the user submit the form to save data...
    Please advice...
    Thanks

    Hi talbo,
    The most reliable method is to use a before-insert trigger on your table. This way the columns will be set properly no matter how rows are inserted (via your app or any other means). Given your user name column is called "CREATE_USER" and your date column is called "CREATE_DATE" for example - include these lines in a before-insert trigger:
    :NEW.CREATE_USER := NVL(V('APP_USER'), USER);
    SELECT SYSDATE INTO :NEW.CREATE_DATE FROM DUAL;The NVL(V('APP_USER'), USER) will set CREATE_USER to the current ApEx application user if the row is created from within the application, or to the current database user if the row is created outside the application.
    Hope this helps,
    John
    If you find this information useful, please remember to mark the post "helpful" or "correct" so that others may benefit as well.

  • SQL LOGIC - How to accept USER input and use that data in SQL Logic?

    Hello Experts
    Can anyone of you please explain in detail how to acheive the above task am a begginner, it would be great help for me.
    Thanks in Advance.

    Hi,
    You mean to say, you need to use inputs from Data manager Prompts in your Script Logic.
    From Help File
    You can use the EvDTSModifyPkg task to dynamically pass a text string to logic in Data Manager.  For example, a user who wishes to dynamically pass a text string representing a year (which is a portion of the *XDIM_MEMBERSET instruction) could use the following steps:
    Using the EvDTSModifyPkg task, prompt for the year, i.e., PROMPT(TEXT,%TEXT%,"select a year")
    Pass the returned %TEXT% to the FormulaScript of the RunLogic task as follows: TASK(RUNLOGIC,FORMULASCRIPT,"*FUNCTION MYYEAR=%TEXT%u201D)
    In the Data Manager logic, use the dynamically created function as follows: *XDIM_MEMBERSET TIME=MYYEAR.INPUT.
    The logic name in the RunLogic task must be specified with the .LGF extension to enforce its validation at run time.
    BPC NW 2.0 Version Works differently.
    Hope this Helps,
    Kranthi

  • How to fetch APPROVER NAME  and approval date dynamically for an user

    Hi all..
    How to fetch approver name and approval date dynamicall for an user in an email template..
    can any help me to sort out this pbm,i am new to IDM..
    Thanks in advance..

    Access policies get a static value.  You can't populate a field with an adapter.  If you must do this, leave the field blank, and put an adapter on the process form for your field that must be populated using code or logic.
    -Kevin

  • How to capture user input for customer exit processing?

    I need to calculate the number of working days elapsed in the current fiscal quarter BASED on the USER INPUT on the reporting front.  i.e., say the fiscal quarter started on 1 July 2005 and if the user enters 10 July 2005, I should get the value 8 (Assume that Monday through Friday are all workdays).  If the user enters 12 July 2005, I should get 10.  I have written customer exits and know how to use factory calendar, but <b>THE CHALLENGE</b> is how do I <b>CAPTURE</b> the user input and use it in my exit?  During the varible definition, if I select the check box "Ready for input" then the customer exit is not being processed and unless I check that box I can't get a user entry!  If I look at the import values in the customer exit, I see i_t_var_range with type rrs0_t_var_range.  My strong feeling is that this parameter gets the user input, but I am unable to use it as the customer exit is not being called if I make the user to input the data.  Based on the empirical evidence, I felt that user input and customer exit can not co-exist!!  Please somebody prove me wrong and let me know how can I use the user input to process my "customer-exit" variable.  I would really appreciate any input from the BW community here.

    Hi Sameer,
    Most likely, I'm missing something, but I think that the answer is very simple.
    CASE I_VNAM.
    WHEN 'YOUR_CUSTOMER_EXIT_VAR'.
    IF I_STEP = 2. “ After selecting of input variable
    LOOP AT I_T_VAR_RANGE INTO LOC_VAR_RANGE
    WHERE VNAM = 'USER_INPUT_VAR'.
    CLEAR L_S_RANGE.
    L_S_RANGE-LOW = LOC_VAR_RANGE-LOW(4).
    APPEND L_S_RANGE TO E_T_RANGE.
    ENDLOOP.
    ENDIF.
    ENDCASE.
    In this typical user exit coding you have a user entered value in LOC_VAR_RANGE (originally in I_T_VAR_RANGE) and you construct your user exit variable value in E_T_RANGE.
    Best regards,
    Eugene
    Message was edited by: Eugene Khusainov

  • How to add User Inputs?

    Well I'm new to Java, and I was trying to make a basic calculator to add 2 user inputs and give a total. Here is my code:
    import java.util.Scanner;
    public class calculator {
         public static void main(String[] args) {
              int total;
              Scanner number1 = new Scanner(System.in);
              Scanner number2 = new Scanner(System.in);
              System.out.print("Enter your first number: ");
              System.out.println(number1.nextLine());
              System.out.print("Enter your second number: ");
              System.out.println(number2.nextLine());
              total = number1 + number2;
              System.out.print("Your total is: " + total);
    }And here is my error:
    C:\Users\Jennifer\Desktop\Vincent's Things>javac calculator.java
    calculator.java:13: operator + cannot be applied to java.util.Scanner,java.util.
    Scanner
                    total = number1 + number2;
                                    ^
    1 errorI tried giving it a cast, since it's saying Scanner's can't be operated, such as:
              total = (int)number1 + (int)number2;But that didn't work. How can I make it so it adds the two inputs?

    A Scanner is a Scanner. Of course you can't just add two Scanners together. The Scanner could also be used to read text. A Scanner can't read your mind to know what type of data you are reading. You have to tell the Scanner what type of data you are reading. They way you do that is to read the Scanner API and use the proper methods.

  • How to pass user name and password in openConnection method ?

    Hi, Exports,
              I am trying to post data from applet to another application which is
              protected by network password.
              How to pass user name and password when I use openConnection method? In java
              doc, this method looks like do not accept these two parameters.
              Thanks
              ----- my code in applet ---------
              URL url = new URL("http://127.0.0.1/xml/index.cfm");
              URLConnection connection = url.openConnection();
              connection.setDoInput(true);
              connection.setDoOutput(true);
              connection.setUseCaches(false);
              connection.setAllowUserInteraction(false);
              DataOutputStream dos = new DataOutputStream(connection.getOutputStream());
              dos.writeBytes("POST " + path + " HTTP/1.0\r\n");
              dos.writeBytes("Referer: http://127.0.0.1/XML/index.cfm\r\n");
              dos.writeBytes("Content-Type:
              multipart/form-data;boundary=---------------------------7d0b414b04\r\n");
              dos.writeBytes("Host: "+host+":"+port+"\r\n");
              dos.writeBytes("Content-Length:" + buff.length()+"\r\n");
              dos.writeBytes("Connection: Keep-Alive\r\n\n");
              dos.writeBytes("-----------------------------7d0b414b04\r\nContent-Dispositi
              on: form-data;name=\"xmlDoc\"\r\n\r\n");
              dos.writeBytes(buff.toString());
              dos.writeBytes("\r\n-----------------------------7d0b414b04--\r\n");
              dos.close();
              

    you need to negotiate Authentication in ur applet code...
              For example:
              If u r using Form based auth u need to send Post a request with j_user_name &
              j_password to the action j_security_check. and when server returns back the
              cookie
              u need to hold it and pass that cookie to the each and every request made to the
              protected application.
              Basically u need to imitate the browser.
              regards
              aseem
              David wrote:
              > Hi, Exports,
              >
              > I am trying to post data from applet to another application which is
              > protected by network password.
              > How to pass user name and password when I use openConnection method? In java
              > doc, this method looks like do not accept these two parameters.
              >
              > Thanks
              >
              > ----- my code in applet ---------
              > URL url = new URL("http://127.0.0.1/xml/index.cfm");
              > URLConnection connection = url.openConnection();
              > connection.setDoInput(true);
              > connection.setDoOutput(true);
              > connection.setUseCaches(false);
              > connection.setAllowUserInteraction(false);
              > DataOutputStream dos = new DataOutputStream(connection.getOutputStream());
              > dos.writeBytes("POST " + path + " HTTP/1.0\r\n");
              > dos.writeBytes("Referer: http://127.0.0.1/XML/index.cfm\r\n");
              > dos.writeBytes("Content-Type:
              > multipart/form-data;boundary=---------------------------7d0b414b04\r\n");
              > dos.writeBytes("Host: "+host+":"+port+"\r\n");
              > dos.writeBytes("Content-Length:" + buff.length()+"\r\n");
              > dos.writeBytes("Connection: Keep-Alive\r\n\n");
              > dos.writeBytes("-----------------------------7d0b414b04\r\nContent-Dispositi
              > on: form-data;name=\"xmlDoc\"\r\n\r\n");
              > dos.writeBytes(buff.toString());
              > dos.writeBytes("\r\n-----------------------------7d0b414b04--\r\n");
              > dos.close();
              >
              > ------------------------------------------
              

  • How to get user input to keep in array in the form of int[]?

    I really want to know how to get user input to keep in an array. Or if it's impossible, can i use the value in "int" and transfer it to an array?

    What I understand is that you want to set an input from the user in an array of int.
    Here is how it work:
    1. Create a stream and a buffer to get and store the informations entered by the user:
    BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
    2. Set this input in a String:
    String input = stdin.readLine();
    3. Set this string in an int:
    int userInput = Integer.parseInt(input);
    4. Then you can put this int in the array.
    Warning this code throws IOExceptions and NumberFormatException ( when you try to set letters as int ). But you can catch them easily.

  • My iPhone 5 has broken and is being replaced with a new iPhone tomorrow. However, My carrier (orange) will b picking up my broken iPhone and I am unsure how to secure the content and icloud data on the broken phone. Is there a way to display the data?

    My iPhone 5 has broken and is being replaced with a new iPhone tomorrow. However, My carrier (orange) will b picking up my broken iPhone and I am unsure how to secure the content and icloud data on the broken phone. Is there a way to disable the data held on it and ensure that if it is fixed, nobody can use/see my data and access my account?

    Hi Gazpan,
    Thanks for visiting Apple Support Communities.
    I recommend using the steps in this article to back up your iPhone if possible:
    iOS: Back up and restore your iOS device with iCloud or iTunes
    http://support.apple.com/kb/ht1766
    You may also find this advice helpful for your situation:
    What to do before selling or giving away your iPhone, iPad, or iPod touch
    http://support.apple.com/kb/ht5661
    If you no longer have your iOS device
    If you're using iCloud and Find My iPhone on the device, you can erase the device remotely and remove it from your account by signing in to icloud.com/find, selecting the device, and clicking Erase. When the device has been erased, click Remove from Account.
    If you're unable to complete either of the above steps, you should change your Apple ID password. Changing your password won't remove any personal information that is cached on the device, but it will make sure that the new owner can't delete your information from iCloud.
    Cheers,
    Jeremy

  • How to get User input in JTextField?

    How to get User input in JTextField? Can u anyone give me some code samples? thanks

    read the API!!!

  • How to make users to select the date from calendar control my making the date field read only in date time control in external list in sharepoint 2010

    How to make users to select the date from calendar control only, by my making the date text field read only (don't want to let users type the date) in date time control in external list in sharepoint 2010. I am looking for a solution which can
    be done through sharepoint desginer / out of the box.
    thanks.

    Congratulate you got the solution by yourself. I am new to a
    WinForms calendar component, I feel so helpless on many problems even I'd read many tutorials. This question on the
    calendar date selection did me a great favor. Cheers.

  • How to change the input and output schema in BPEL process

    hi',
    Please tell me how to change the input and output schema in BPEL process after the process is made.
    thanks
    Yatan

    If your intention is just changing the content you are passing to bpel/returning from bpel
    Here is another way
    just update your default created xsd files with new elements, update wsdl elements in message definition and chnage bpel code to reflect new elements in activities
    Regards,
    Praveen

  • How to print  both normal and bold data in a single line

    Hi ,
    I have requirement wherin the data need to be displayed in a single line.
    FAX:              Z8525_text.
    where FAX needs to be in bold and Z8525_text is a standard text and it shoould not be bold , both of this needs to be displayed in
    a single line.
    Can you let me know how to print  both normal and bold data in a single line one of which is coming fro standard text.
    Regards,
    Senthil

    Hi Senthil,
    If you are using smartforms, have a character format created for BOLD and apply it to the text you want to highlight. The remaining text of the line could be applied with a Character format which is not highlighted.
    Try and revert in case you need further assistance

  • How to validate user name and password in webdynpro.

    Dear All,
    Actually i have created login name and password in view, webdynpro and want to validate the user name and password but  i am not finding proper code to  how to validate user name and password.
    Pl do the needful help.
    Regards.
    Tazeer.
    Moderator Message: There is a seperate forum for WebDynpro. Please ask your question there.
    Edited by: kishan P on Oct 5, 2010 1:08 PM

    Hello, I don´t get you question. User authentication is ready out of the box in webdypro...
    Regards Otto

Maybe you are looking for

  • JDBC Connection reset by peer: JVM_recv in socket input stream read

    Hey Guys, Has anyone seen this issue? We get this error in our Weblogic app logs at times and no one is able to login to our application. Our database server and SQL server seem fine at a high level. Any ideas what is causing this? com.s1.arch.persis

  • Cumputer crashing when syncing photos to iPad

    When I sync photos to my iPad my computer crashes.  Not just iTunes, but my computer shuts down.  The time it takes for the crash to happen varies.  I read on a post from earlier this year to delete the photo cache and try again.  This makes iTunes t

  • Problems with lucreate

    Hi, I am running into problem when trying to upgrade a solaris 10 installation. The root partition is mirrored and the /opt is in another filesystem. I created a copy of /opt in a metadevice d8 and want to detach one device from the mirror to create

  • Help me pleaser(MovieClipLoader)

    Hello guys Iam using the MovieClipLoader object to load multiple jpg images by getting their names from a xml file but agfter a minute or two images are disappearing.In other words I can still get a hand cursor by rolling over them but I cant see the

  • Any info on ASA hardening

    Is the ASA pre-hardened? Any info about hardening this ASA?