Share on Google+Share on Google+

4 Answer(s)      8 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="*"%>

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

<[email protected] import="java.sql.Connection"%>
<[email protected] import="java.sql.DriverManager"%>
<[email protected] import="java.sql.PreparedStatement"%>
<[email protected] 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 [email protected]
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
Java Spring Hibernate Struts Training how to retrieve text and images from mysql database and show on html page using jsp servlet How to install Neo4j on Ubuntu 15.10? please help me in these prog MYSQL - mysql copy table to another table example by creating new table solution for mapping hibernate and pojos from net beans through database Connect GWT application with Oracle inventory System of Medical Store inventory System of Medical Store inventory System of Medical Store inventory System of Medical Store This code have created jTable that connected with a database.every cell of last column have a button.But this button doesn't work properly.Where is the error java program Java Database Program jdbc Database connection class in a live project ..?? What is JDBC architecture? Unable to Create DSN for excel to ms access importing data and edit that data Database Scrolling Buttons how to use foreign key in java How to delete content of a log file from linux terminal? JSP-Oracle connectivity Student Management System Java code for Saving Marathi (Indian local language ) in Mysql and retrieving the same crud operations with foreign key constraint. I really need help with this assignment question Please help me out Please Backup Failed Mysqldump Got Errno 28 On Write Upgrade MySQL 5.1 to 5.5 in cpanel mysqldump all databases com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'jpa.sequence' doesn't exist persistence xml class element persistence.xml for MySQL MySQL JDBC Driver pom dependency code Blob column jdk6 and oracle 8i connexion oracle 8i et jdk6 java [ cannot retrive date from sql ] why?? Order Entry System How to threow timeout exception when DB is not responding How to threow timeout exception when DB is not responding This is the employee form to add data to mysql database but I got error of NullPointerException, Is this write code please give me feedback as soon as possible make a method which takes user name & pwd as parameter & validate them against the database. If the corresponding user exist return true otherwise false. prabhakar validating credentials and displaying error message in login .jsp if not valid JDBC jdbc jdbc code register servlet vibhu connectiondetails from vibhu


Advertisement null