Latest Tutorials| Questions and Answers|Ask Questions?|Site Map

Home Answers Viewqa JDBC jsp-jdbc

View Questions and Answers by Category


Have Programming Question? Ask it here!

4 Answer(s)      6 years and 7 months 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="*"%>

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 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  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 - 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.
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
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
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 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 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...
jsp - JDBC
about update at
jsp - JDBC
jsp  -------------------------------------------------------------------------------- how to receive data into jsp from html for dropdown boxes
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\ cannot find symbol symbol : variable src location: class org.apache.jsp.Flightdetails_jsp
jsp - JDBC
variable. JSP Page... Login Successful <%-- <jsp:forward page="studenthome.jsp"/>...   2)action.jsp: JSP
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... question is do i need to have depth knowledge of servlets jsp and jdbc..plz reply me asap at
Query regarding JSP, JDBC
Query regarding JSP, JDBC  I have a table in SQL Server database storing some ids and names. In my jsp code a while loop is displaying the list of names from the database as links. I want that on click of a link of name furthur
Java JSP  JDBC connectivity in JSP?  Hi Friend, Please visit the following link: Hope that it will be helpful for you. Thanks
servlets and jsp - JDBC
servlets and jsp  I want to display textboxes dynamically in my page using JSP and servlets (javascript for validation). For eg, consider the recruitment application form for various jobs. The name, address and tel
pagination in jsp - JDBC
. Simple pagination in jsp... ------------------   Simple pagination in jsp Simple pagination in JSP Displaying Records
Displaying Date in jsp - JDBC
in a database.i am getting input value from HTML and i use jsp application to interact with database.My JSP code for inserting Date is below: String dateStr... ----------------------------------------- Read for more information. Thanks
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