Share on Google+Share on Google+

4 Answer(s)      9 years ago
Posted in : JDBC
View Answers

September 25, 2008 at 6:15 PM

Hi Dear,

Please Write clearly what is your requirement

and write your code also i can suggest you.

you are getting error on

request.getParameter(); its taking String parameter from other page may be that name is spelling mistake

so once again check your code.



September 25, 2008 at 11:03 PM

Dear Rajkumar,

Pl. tell me how to write the oracle query which is commented in ashok.jsp program.How should I pass request.getParameter or fname, lname, add,phones (from html input parameters), because it compiles, runs without any error but in the databse it is not stored.


<form action="ashok.jsp" method="post">

First name:<input type="text" name="firstname"><br>
Last name: <input type="text" name="lastname"></br>
Address:<input type="text" name="address"><br>
Phone No:<input type="text" name="phone"></br>

<input type="submit" value="Submit">


<%@ page language="java" contentType="text/html"%>
<%@ page import="java.sql.*"%>
<%@ page import="java.io.*"%>

String fname="",lname="",add="",phones="";


out.println(fname);//it prints the parameter correctly

Connection con="DriverManager.getConnection("jdbc:odbc:ashokdb","scott","tiger");

Statement st=con.createStatement();

//here How I should write in oracle so that all the parameters filled in the html is stored in the oracle database named ashoktable pl.?

st.executeUpdate("insert into ashoktable values(......);");
}catch(Exception e){}


September 26, 2008 at 12:10 AM

Hi Krishna

<%@page import="java.sql.Connection"%>
<%@page import="java.sql.DriverManager"%>
<%@page import="java.sql.PreparedStatement"%>
<%@page import="java.sql.Statement"%><%
String fname= request.getParameter("firstname");
String lname="";
String add = "";
String phone = "";
//do your code here
Connection con = DriverManager.getConnection("","","");
String query = "INSERT INTO ashoktable values(?,?,?,?)";

PreparedStatement pst = con.prepareStatement(query);



//OR this way alos

//String query1 = "INSERT INTO ashoktable values("+fname+"," +lname+"," + add+","+ phone +")";
//Statement stmt = con.createStatement();



September 26, 2008 at 3:22 PM

Dear Rajanikanth,
thank you very much for posting the answer.
Now the code is working.

thanks a lot.


Related Tutorials/Questions & Answers:
Query regarding JSP, JDBC
Query regarding JSP, JDBC  can I get the code for the question asked by me regarding JSP,JDBC
Jsp,JDBC  Write a Program using Servlet,JSP, JDBC and XML to create a web application for a courier company to provide an online help in tracking the delivery status of items.  Hi friend, For solving the problem
jsp jdbc Spring
jsp jdbc Spring  I need to create the form in jsp with one field.The field is user id. On submitting the form all the details associated... how to link the user id field of jsp with the database using spring mvc
jsp-jdbc - JDBC
jsp-jdbc  Hi! html- jsp-jdbc program from the html form where... jsp frequently. I am getting error through request.getParameter(). can you please...="DriverManager.getConnection("jdbc:odbc:ashokdb","scott","tiger"); Statement st
Help on JSP and JDBC - JDBC
Help on JSP and JDBC  Retrieve data from Database in JSP and JDBC...;% Connection con = null; String url = "jdbc:mysql://localhost:3306/"...;hi friend, jsp only for view , we should use for presentation don t
JSP-jdbc validation - JSP-Servlet
JSP-jdbc validation  How to validate login email id using JSP, where..., login application in jsp function validateForm(theForm... for more information. http://www.roseindia.net/jsp/valid-email
courier management service (using servlets,jsp,jdbc)
courier management service (using servlets,jsp,jdbc)   is anyone having information about courier management service ? plz share it .its urgent THANKING YOU IN ADVANCE
jsp - JDBC
variable. JSP Page... Login Successful <%-- <jsp:forward page="studenthome.jsp"/>...   2)action.jsp: JSP
jsp - JDBC
jsp  how to link jsp code with next htmlcode.  Hi keerthi, Can u explain ur question clearly? What is your exact Requirement
jsp - JDBC
: Unable to compile class for JSP An error occurred at line: 20 in the jsp file...\localhost\Airlines-Project\org\apache\jsp\Flightdetails_jsp.java:69: cannot find symbol symbol : variable src location: class org.apache.jsp.Flightdetails_jsp
jsp - JDBC
jsp  -------------------------------------------------------------------------------- how to receive data into jsp from html for dropdown boxes
jsp - JDBC
about update at http://www.roseindia.net/jsp/implement-javascript
jsp - JDBC
JSP Storing Data, Datatype vale in SQL   Storing Data, Datatype vale...;<%Connection con = null; String url = "jdbc:mysql://localhost:3306... to sql database using JSP and Servlet here...http://www.roseindia.net/answers
JSP Store Results in Integer Format  JSP Example Code that stores the result in integer format in JSP  Hi! Just run the given JSP Example...;/b></td><% Connection con = null; String url = "jdbc:mysql
jsp - JDBC
jsp  I have one jsp code.but it is included oracle databse...("oracle.jdbc.driver.OracleDriver"); Connection con = DriverManager.getConnection("jdbc:oracle... = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:oracle","scott","tiger"); I
jsp - JDBC
jsp  i am doing project in java using jsp as font end and microsoft access as back end my project airline ticketing reservations how can i give hyperlink to database rows in jsp code.   First
JSP,JDBC and HTML(Very Urgent) - JSP-Servlet
JSP,JDBC and HTML(Very Urgent)  Respected Sir/Madam, Thanks... details from database using JDBC and JSP. The home page i.e HTML Page must contain... the code: I am not using any html. I used only jsp & jdbc. HOme Page
is it necessary to have depth knowledge on servlets jsp and jdbc to learn java frameworks
is it necessary to have depth knowledge on servlets jsp and jdbc to learn java... knowledge..my question is do i need to have depth knowledge of servlets jsp and jdbc..plz reply me asap at [email protected]
JSP and JDBC - JSP-Servlet
JSP and JDBC  Respected sir/Madam, I am R.Ragavendran.. I am in urgent need of programming from roseindia team.. My requirement... for JDBC codings must be present.. NOTE: When User clicks Insert,for example
Help on JSP - JDBC
and search the database from the html file with the help of JSP.  hi...;jdbc:oracle:[email protected]:1521:xe","scot","tiger"
jdbc,jsp - JDBC
jdbc,jsp   this is my jsp code in this code i have to give hyperlink to database(selected row must be deplay)  Hi keerthi, replace the line
JDBC in JSP   Sir, This is the code showing the problem. regards sreejith
JDBC in JSP   Sir, This is the code showing the problem. regards sreejith
JDBC in JSP  Sir, I got a problem in my jsp page which contains a delete query to delete the fields from MySql DB. The delete query is working.... Regards Sreejith  send me your jsp coding then i can understand what


Advertisement null