running given code i got fallowing error
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: An exception occurred processing JSP page /prepared_statement_query.jsp at line 91
88: }
89: finally {
90: // close all the connections.
91: pstatement.close();
92: connection.close();
93: }
94: }
Stacktrace:
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:553)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:457)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:391)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:393)
root cause
java.lang.NullPointerException
org.apache.jsp.prepared_005fstatement_005fquery_jsp._jspService(prepared_005fstatement_005fquery_jsp.java:144)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:419)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:391)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:393)
note The full stack trace of the root cause is available in the Apache Tomcat/7.0.11 logs.
The Query string should be
String queryString = "INSERT INTO stu_info(Name,
city,Phone) VALUES (?, ?, ?)";
instead of
String queryString = "INSERT INTO stu_info(Name,
Address,Phone) VALUES (?, ?, ?)";
Hai....if u r not getting the output,the problem made by this line i.e insert into stud_info(Name,City,Phone)values(?,?,?);...Rectify this line and get the output buddies...bye
Dear sir i hav a problem that...
I hav created the sign up form and validated trough the form bean..for error message to display to the user,that is working fine and once registration is sucssfully completed it should display to the user that ---dear so and so u have successfully register(along with whatever details that the person entered should display)--this is also working fine..
I hav probelm in storing it in mysql (Database)table....
I hav problem that once the form is validated then only it should be display in another jsp page(showing details t the user) and also store it in database...so can anybody solve ma issue please...(without connecting to the database its working fine.....)
i did everything as mentioned above but still its showing connection error. What should i do to get this code running?
Am i making some silly mistake? please help me!
I am getting an error in Eclipse wen i am workin vth a project of two files index.html and display.jsp i hav used prepare statement to give the values in to the oracle database, i.e the error is prepared stmt's objs z nt resolve ps is nt reslove....help me and urgent.
javaAJAY ARANKERI April 11, 2011 at 3:10 PM
i wants to insert in database the current system date through the java on frame button event
errornat April 18, 2011 at 5:33 PM
Getting error: Connection cannot be resolved to a type PreparedStatement cannot be resolved to a type
inserting values in databaseGaurav Trivedi September 29, 2011 at 5:00 PM
running given code i got fallowing error type Exception report message description The server encountered an internal error () that prevented it from fulfilling this request. exception org.apache.jasper.JasperException: An exception occurred processing JSP page /prepared_statement_query.jsp at line 91 88: } 89: finally { 90: // close all the connections. 91: pstatement.close(); 92: connection.close(); 93: } 94: } Stacktrace: org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:553) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:457) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:391) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334) javax.servlet.http.HttpServlet.service(HttpServlet.java:722) org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:393) root cause java.lang.NullPointerException org.apache.jsp.prepared_005fstatement_005fquery_jsp._jspService(prepared_005fstatement_005fquery_jsp.java:144) org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) javax.servlet.http.HttpServlet.service(HttpServlet.java:722) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:419) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:391) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334) javax.servlet.http.HttpServlet.service(HttpServlet.java:722) org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:393) note The full stack trace of the root cause is available in the Apache Tomcat/7.0.11 logs.
There is error in the queryanuja October 28, 2011 at 1:01 PM
The Query string should be String queryString = "INSERT INTO stu_info(Name, city,Phone) VALUES (?, ?, ?)"; instead of String queryString = "INSERT INTO stu_info(Name, Address,Phone) VALUES (?, ?, ?)";
jspAsha November 22, 2011 at 3:54 PM
Hai....if u r not getting the output,the problem made by this line i.e insert into stud_info(Name,City,Phone)values(?,?,?);...Rectify this line and get the output buddies...bye
queryNagesh February 24, 2012 at 10:54 AM
Dear sir i hav a problem that... I hav created the sign up form and validated trough the form bean..for error message to display to the user,that is working fine and once registration is sucssfully completed it should display to the user that ---dear so and so u have successfully register(along with whatever details that the person entered should display)--this is also working fine.. I hav probelm in storing it in mysql (Database)table.... I hav problem that once the form is validated then only it should be display in another jsp page(showing details t the user) and also store it in database...so can anybody solve ma issue please...(without connecting to the database its working fine.....)
about the codeneha April 10, 2012 at 8:58 AM
i did everything as mentioned above but still its showing connection error. What should i do to get this code running? Am i making some silly mistake? please help me!
insert data in database through jspnaouel October 6, 2012 at 5:00 AM
i have do every steps : create database and table ..ect and have copy this code but it dosen't work please help me
Not able to connect to dbANiket October 9, 2012 at 12:54 AM
I am totally unable to connect to mysql. Getting message as "Unable to connect to database. " Please help
mistakeTHOMASKUTTY BABY December 29, 2012 at 9:09 AM
in this code one mistake "insert into" statement has a field name Address that is not the field of table stu_info check it
PreparedStatement (database) and JspSantosh December 21, 2012 at 5:08 PM
I am getting an error in Eclipse wen i am workin vth a project of two files index.html and display.jsp i hav used prepare statement to give the values in to the oracle database, i.e the error is prepared stmt's objs z nt resolve ps is nt reslove....help me and urgent.
unable to connect (eclipse )shan November 8, 2012 at 2:52 AM
hi im using eclipse to use java program..in this program code not inserted in database , plz help me out of the problem regards sundhar
do really it worksBagavan April 5, 2013 at 2:42 PM
do really it works?
Good Jobmain April 28, 2013 at 5:09 AM
you are a master brother! thank a lot.
jsp heplnitesh April 15, 2011 at 2:08 PM
sir, i am mca final year student a need your help for crating forum in jsp please send me the code and link to my mail nitesh gadekar
Post your Comment