Form test in jsp

I like to thank steve for the reply of the previous message posted .With the reply i have been able to resolve the problem .
Another issue is that i can't find any data entered through my html form in my access database table.Can anyone help here? what should i do.
I am new to jsp technology.I am from Nigeria.The code for the form and the jsp that handles the request is provided below.
Test.html
<form action="/Apps/Test.jsp" method="post">
<center>ID <input name="id" type="text" >
NAME <input name="name" type="text" >
AGE <input name="age" type="text" >
<input type="submit" value="Enter Entries"/>
<input type="reset" value="reset Entries"/>
</center>
</form>
Test.jsp
<%@page contentType="text/html" import="java.sql.*"%>
<%@page pageEncoding="UTF-8"%>
<%
Connection conn= null;
Statement stat = null;
String idNum = request.getParameter("id");
String name1 = request.getParameter("name");
String age1 = request.getParameter("age");
try{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
conn= DriverManager.getConnection("jdbc:odbc:Tester","bart","college");
stat=conn.createStatement();
stat.execute("INSERT INTO STUDENT"+
"VALUES(id,name1,age1)");
stat.close();
conn.close();
catch(Exception e){e.printStackTrace();}
%>
<html>
<head><title>JSP Page</title></head>
<body>
<%-- <jsp:useBean id="beanInstanceName" scope="session" class="beanPackage.BeanClassName" /> --%>
<%-- <jsp:getProperty name="beanInstanceName" property="propertyName" /> --%>
</body>
</html>
I am using Netbeans as my IDE,Microsoft Access as my database and Apache Tomcat as my web server.I need the reply urgently.Is there any setting and configuration i need to carry out before i can see any data in the database?

Hi,
Just try to replace your following jsp code ....
try{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
conn= DriverManager.getConnection("jdbc:odbc:Tester","bart","college");
stat=conn.createStatement();
stat.execute("INSERT INTO STUDENT"+
"VALUES(id,name1,age1)");
stat.close();
conn.close();
catch(Exception e){e.printStackTrace();}
%>This part should be replaced with following one...
try{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
conn= DriverManager.getConnection("jdbc:odbc:Tester","bart","college");
stat=conn.createStatement();
stat.execute("INSERT INTO STUDENT"+
"VALUES('"+id+"','"+name1+"','"+age1+"')");// if in your database all fields are of type 'varchar'
stat.close();
conn.close();
catch(Exception e){e.printStackTrace();}
%>hope this helps you...
Regards,
Gaurav Daga

Similar Messages

  • How to test the JSP pages and sevlets using JUnit. ?

    How to test the JSP pages using JUnit. How to configure what are all the steps to execute the JUnit test cases.

    Hi xiepei,
    since you are using modbus, a simple error checking is implicit in the protocol and is the comparison between returned checksum and the calculated one on the received message: checksum errors, if any, are an effect of communications errors (you should have at least 2 bits changed and on particular patterns to have the checksum be calculated correctly!). You won't be able to calculate BER on them, but you can calculate PER (Packet Error Rate).
    Another flag for communication errors, on the other direction, is to intercept error messages from the device: if it fully implements modbus protocol, it should return some warning in case of error (I seem to remember that in some cases it returns the reveived message with some error bits added: please check in modbus documentation).
    Proud to use LW/CVI from 3.1 on.
    My contributions to the Developer Zone Community
    If I have helped you, why not giving me a kudos?

  • Accessing values of components in a form in a JSP function

    Hi,
    I have a peculiar problem. I want to access the value of a textbox in my JSP method. Please let me know how to do that.
    The code is
    <%!     
         public boolean checkFile(String filepath)
         System.out.println("************ " + filepath);
         File f = new File(filepath);
         return (f.exists());
    %>
    the variable filepath should be the value taken from a text field.
    When the user enters a file name i need to check if the file exists or not. Is there a better way to do this. Please suggets me a way to solve this.. Very urgent.
    Thanks
    pops

    Well JSP is server side code and TextBoxes are html which is client side script. To get the value of an html Textbox you either can use Javascript and do it all client side or you can post your form to a JSP or servlet and use request.getParameter("field_name"); to get the value of the form field.
    make sense?
    -S-

  • Is it possible to use two diff forms in same jsp/jsf page?

    Hi all,
    My requirement is to submit the form based on selection of radio button.
    since half part needs to be jsp based which is not using any tags etc.
    But i am trying to use some jsf based component which requires to be inside <f:view><h:form> of
    <%@ taglib prefix="f" uri="http://java.sun.com/jsf/core" %>
    <%@ taglib prefix="h" uri="http://java.sun.com/jsf/html" %>
    i.e. some <c:comboBox>
    </h:form> </f:view>
    Now earlier i was submitting the form as
    <form action="/techstacks-v2_1/reportAction.do" method="post" name=doSearch id='doSearch'>
    But now i found, in order to use combo box component which is entirely jsf based i need to use <f:view><h:form> which is kind of taking over the previous form submission mechiansm.
    I am trying to keep them separate as two differnt forms.
    one entirely jsp based and other as jsf based.
    Now my question is can i use such way of doing so or is there any better way of implementing so.
    My friend suggested that i can pass the value of jsf based form in hidden form to a input box of form to be submitted finally instead of submitteing two diff forms.
    but in that case also i ahev to use two forms in a single jsp/jsf page.
    suggest me something which can really work out.
    thanks
    vijendra

    You can use as many forms as you want as long as you don't nest forms. The HTML spec probibits that.

  • How to make result of form post to jsp to appear in child frame

    Two frames inside a frameset, A and B (A is the first frame, B is the second). A has as it's source an html page containing a form with a submit button. The form posts to a jsp called Content.jsp. Works great, except: I want the results returned by Content.jsp to appear inside frame B. Seems like I've got the target for the form inside A wrong somehow, because when I click the submit button inside frame A, my results appear in a new browser instance, rather than inside B. Here's what the form declaration looks like:
    <form action="Content.jsp" method="post" target="_parent.frames[1]">
    If I make the target parent, that obviously replaces the whole page. If I make the target self, that obviously replaces the contents of frame A. I want to replace the contents of frame B. Any ideas?

    Thanks, but I'm not using IFrame, just Frame and FrameSet. In any event, I have tried using the name attribute to no avail. Here's a really simple version of the code:
    //Parent frameset
    <frameset rows="50%,50%">
    <frame name="A" src="testSubmit.html">
    <frame name="B" src="">
    </frameset>
    //Here's the form in testSubmit.html
    <form ACTION="testResult.html" METHOD="POST" TARGET="_parent.B">
    <input TYPE="SUBMIT" VALUE="Click Me">
    </form>
    I've also tried TARGET="_parent.frames[1]" with the same result -- a new browser window is launched rather than the results being displayed in B.
    Thanks for any assistance.

  • ADF Search form inside a jsp page's panel page container

    I am going through the Oracle JDeveloper 10g for Forms & PL/SQL book and I got to page 391 where I need to drop a search form onto a jsp page set up with a panelpage. The form show up but when I go to delete the extra fields JDeveloper completely locks up. I am running JDeveloper version 10.1.3.3.0.4157. I tried reinstalling it and it still locks up. I tried going back a few steps and recreate the search form and it still locks up.
    Can anyone explain why it is locking up or how to delete the extra fields without locking up?

    I also tried selecting a field in the source file code window. Just selecting a field in any form or window locks up JDeveloper. My program worked find until I created a search form from a data set. I think it is a bug in the version of JDeveloper I have. I did a similar task in a previous version and it worked fine. I could select and delete fields with no problem.

  • Web form tester

    Can any body tell me what is the url I should write in my browser to down load the web form tester through which i can send my connection information to the form server .
    Thanks in advance.

    I mean like we use isqlplus to access our database server from any computer that has no thing to do with oracle (there is no oracle installed in) only by using the browser by writing the following on the address bar:
    http://Ip: 80/isqlplus then it down load isqlplus page for inserting connection information. Now I'm looking for the URL that I should write on the address bar I can access my application server where is my forms and application logic is reside.
    Thanks for your patience

  • Web form tester. don't run the form.

    Dear all,
    i am using oracle 8i and forms 6i.
    i am trying to run the web form tester but it give error.
    i gave the forllowing parameters:
    form : D:\Accano\logonscreen.fmx
    Userid : mis
    other parameters : useSDI= yes ( what is this?)
    Look and Feel: Generic
    Color Scheme : Teal
    Web listener (HTTPD) Detail
    web host : aserver
    web port : 80
    the HTTP server is already installed.
    please hlpe me what is wrong?
    thanks
    Muhammad Nadeem

    ok so u had installed WebDB right?
    next thing have u configured your WebDB server...???
    now u will ask me how can I configure that...then the ans is when u finished
    installing forms....there must be one message box telling you view instruction....
    remember that...ok u can get it now from...."forms6iconfig.txt" in your forms home.

  • Installing second domain for forms testing environment?

    Hi!
    I've a physical windows server for running my forms applications (11.1). On installing fusion middleware suite I created a domain with the assistant. Further more another assistent configured my forms server into this domain.
    The problem is that I've no forms testing environment. So the idea was to create another domain for testing and setup a second forms server in this new testing domain. The pysical machine has enough power to server both domains.
    Is this a supported configuration and can it be done with the assistants?
    Thanks
    Markus

    I wouldn't say that the additional administration effort is much or bad. I also don't agree 100% that the dev instance don't influence the prod instance when both are hosted on the same server.
    When hosting both instances on one server and one oracle home you will always be on the same patchset on the OS and Oracle side.
    Consider you are encountering a bug in forms when developing a new feature which is fixed in a one-off patch. To test this one-off patch in dev you most certainly will have to take down the production instance too as both of them will access the same Oracle Home and Middleware Home. Same thing is for OS patches. If you are seperating dev and prod instances on different machines you have the possibility to test your configurations proper on your test machine without influencing production.
    This will guarantee you that you have always a tested environment in production.
    Think about scalability: developers tend to make boo-boos while developing new things. One forms session <can> take down a whole machine (I have seen that and I have done that - on a development machine). If this happens on a development machine you have 10 angry developers which can be calmed down with a sixpack beer; 100+ people plus the managment which should be working with the software you developed are not tranquilized so easy when they cannot work for 20 minutes because of a infinite loop in development ;).
    I agree that you might have additional license costs; but if memory serves Oracle VM and Oracle Enterprise Linux have no additional license costs which breaks down the costs to OFMW 11g. And I am not too sure if you have to pay (the full price) for development instances (I am a developer, not a sales person). But this is best discussed with your oracle sales representative.
    Again, this is just my opinion; maybe someone else can give you more input.
    cheers

  • How to pass one JSP form to next JSP ?

    i am using the two JSPs. i want to pass the form name of the first JSP to the second JSP and then assign the form name to second JSP form

    i have tone JSP file which is will be added to any JSP... This is my requirement.
    So i want to get the parent JSP form name and asign to the this JSP form name ... so that this code will be Generic

  • Network speed test in jsp

    I would like to know which APIs are necessary to develop a network speed tester in jsp or which method to do this, knowing about which APIs it's necessary, I will study them. Here is a example of a network speed tester that I'm trying to do
    Examples:
    http://www.coiinc.com/speedtest/initialmeter.php
    http://www.pcativo.com.br/testes.asp?teste_tipo=velocidade
    http://www.navegante.com.br/medidor/initialmeter.php
    http://medidor.interair.com.br/
    http://www.rjnet.com.br/velocimetro/index2.htm

    Sir,
    For at least a couple of these options it appears that the test is actually based on JavaScript.
    What seems to happen is that at the beginning of the page there is a JavaScript variable that is set with the time.
    Then there is a big amount of some sort of data. Which I would guess has been measured to be X big. Let's say 1 MB.
    Finally there is another bit of Javascript which again takes the time and then finds out the difference and from that one can sort of conclude the time difference.
    But I am not convinced this will always work perfectly but who knows... anyway your use of JSP wouldn't preclude you from just basically copying what these others are doing.
    Sincerely,
    Slappy

  • Oracle Form Vs OAF JSP Form

    I have some basic questions regarding Oracle Forms and OAF JSP forms. There is a requirement by the client to create custom forms for a functionality not available in Oracle Applications R12. I have to make the decision if Oracle forms or OAF JSP should be used to develop these forms. I have been told that both are supported in R12. I would like to know what is the advantage of doing one over the other? What factors do I need to consider?
    Thanks

    and the appeal is not only about good looking UI, but more on making better user experience, less coding effort, easy maintenance, low cost (on hardware/software), thin clients, and the reason for whole internet revolution based on browser based applications
    Tapash

  • Web form tester did not show

    I have installed Forms6i, Forms Server 6i, and JInitiator. When I followed the instruction to run the Web Form Tester. it only opened an empty browser screen. Help. Thanks in advance.
    Blake
    null

    Blake
    I'm having the same problem. Have you been able to resolve it.
    Thanks in advance
    Sandy
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Blake ():
    I have installed Forms6i, Forms Server 6i, and JInitiator. When I followed the instruction to run the Web Form Tester. it only opened an empty browser screen. Help. Thanks in advance.
    Blake
    <HR></BLOCKQUOTE>
    null

  • Passing FORM parameters when opening form from a JSP

    Hi,
    is it possible to pass form parameters when opening the form from a JSP as a URL. If yes then what should be the way in which parameters has to be passed.
    thanks.

    Hi,
    Sorry there was some confusion.
    I want to pass parameters to a (D2K) form from a JSP. I'm able to open the D2K form but unable to pass the parameters into that form.
    Is it possible to pass parameters to D2k FORM from a JSP...
    Thanks

  • Test Oracle JSPs with Tomcat

    I wanted to test my JSPs calling Oracle in Tomcat before moving
    them over to our 9iAS webserver. I put the ojsp.jar and
    ojsputil.jar in the tomcat\binary\lib\ directory. Where do I
    put the JSPs? I am not sure but don't I need to add something to
    the server.xml file?
    Thanks,
    Tom Henricksen

    Hi
    I never installed OUS on Tomcat...
    Anyway as shown in the error message you have a problem with the configuration of the connection pool. Perhaps the JNDI name is wrong.
    Chris

Maybe you are looking for