Online Training Spring Hibernate Training in Delhi R Programming Training Course Big Data and Hadoop Training Java Training  
 

please fix the error

Ads

 
 

Share on Google+Share on Google+

hello
please fix the error
1 Answer(s)      5 years and 4 months ago
Posted in : JSP-Servlet
org.apache.jasper.JasperException: Unable to compile class for JSP: 

An error occurred at line: 14 in the jsp file: /doctor.jsp
Invalid character constant
11:     Connection con=DriverManager.getConnection("jdbc:mysql://localhost:3306/phs", "root", "root");
12:     Statement s=con.createStatement();
13:     
14:            ResultSet rs=s.executeUpdate("insert into patient(prescription,treatment) values('"+slip+'",'"+treaty+"') where id='"+pid+"'");
15:           int count=0;
16:           while(rs.next())
17:           {
///////////@@@@the above mentioneed is error and code is as follows



<%@ page import="java.sql.*,javax.sql.*" %>
<%@ page import="java.util.*, java.lang.*" %>


  <% 
try{
String pid=request.getParameter("id");
String treaty=request.getParameter("treat");
String slip=request.getParameter("pres");
 Class.forName("com.mysql.jdbc.Driver");
    Connection con=DriverManager.getConnection("jdbc:mysql://localhost:3306/phs", "root", "root");
    Statement s=con.createStatement();

           ResultSet rs=s.executeUpdate("insert into patient(prescription,treatment) values('"+slip+'",'"+treaty+"') where id='"+pid+"'");
          int count=0;
          while(rs.next())
          {

                 out.println("PAtient record updated");
          }


    }
    catch (Exception e){
    out.println(e);
    }

%>
Ads
View Answers

March 31, 2012 at 1:34 PM


We have modified your code. Here is your modified code.

<%@ page import="java.sql.*" %> 
<%@ page import="java.util.*"%>
<%@ page import="java.lang.*"%>    
<% try{ 
    String pid=request.getParameter("id");
String treaty=request.getParameter("treat"); 
String slip=request.getParameter("pres"); Class.forName("com.mysql.jdbc.Driver");
Connection con=DriverManager.getConnection("jdbc:mysql://localhost:3306/phs", "root", "root");
Statement s=con.createStatement();
s.executeUpdate("insert into patient(id,prescription,treatment) values('"+pid+"','"+slip+"','"+treaty+"')");
      int count=0;
      while(rs.next())
      {

             out.println("PAtient record updated");
      }


}
catch (Exception e){
out.println(e);
}

%>

Ads









Related Tutorials/Questions & Answers:
please fix the error
please fix the error  org.apache.jasper.JasperException: Unable to compile class for JSP: An error occurred at line: 14 in the jsp file...: { ///////////@@@@the above mentioneed is error and code is as follows
please how fix this error?
How to Fix Error   for this following code : $var1 = $_POST["name"]; $var2 = $_POST["id"]; $st = 'INSERT INTO USERNAME(id,name) VALUES(:var1,:var2)'; $query = ociparse($con,$st); OCIBindByName($st ,':va1',$var1
Advertisements
need to fix errors please help
need to fix errors please help  it does have 2 errors what should i fix? import java.io.*; class InputName static InputStreamReader reader = new...; String name2; System.out.println("please enter your name:"); name1= input.readline
How to fix HAX Kernel Module Is Not Installed error?
How to fix HAX Kernel Module Is Not Installed error?  Hi, How to fix HAX Kernel Module Is Not Installed error? Android studio gives following error: emulator: ERROR: x86 emulation currently requires hardware acceleration
Please help me fix this code - MobileApplications
Please help me fix this code   Please help me in this area of code..., Confirm, Check2, Confirm2, delete; Alert error, errora, Alerta... expenses)", "Please fill all required field \n \n * This signify required field
one error but i dont know how to fix it o_O!!!
one error but i dont know how to fix it o_O!!!  where is the mistake here ?? import java.utill.Scanner; public class Time { public static void..."); } } the compilar told me that there is only one error... thx
Logic error? HELP PLEASE! :(
Logic error? HELP PLEASE! :(  Hello Guys! i have a huge problem. What... your saved Quick Quotes, please enter your Email Address...("emailAddress")) + " Please input a valid email address
error please send me the solution
error please send me the solution  HTTP Status 500 - type Exception report message description The server encountered an internal error () that prevented it from fulfilling this request. exception
error please send me the solution
error please send me the solution  HTTP Status 500 - type Exception report message description The server encountered an internal error () that prevented it from fulfilling this request. exception
please solve this error Warning: mail() [function.mail]:
please solve this error Warning: mail() [function.mail]:   please solve this error Warning: mail() [function.mail]: "sendmail_from" not set in php.ini or custom "From:" header missing
403 Forbidden error - What is 403 Forbidden error, please explain...
403 Forbidden error - What is 403 Forbidden error, please explain...  Can anyone please explain, What is 403 Forbidden error. And how can i remove this error, which is restricting my page from loading it. Thanks!!   Hi
Syntax error in my UPDATE..please advise
Syntax error in my UPDATE..please advise  Hi experts, I tested my code and NetBean IDE gave me the following message:- You have an error...; stmt.executeUpdate(sql); Please advise how should I change my SQL to use Heidi MySQL
Grid World project Run Error !! help please!!
Grid World project Run Error !! help please!!  i'm trying to make...); } } } } and Here is my error...: (it runs at first but when the bug hits a side, the error occurs and i exit the error but run does not work anymore
403 Forbidden error - What is 403 Forbidden error, please explain...
403 Forbidden error - What is 403 Forbidden error, please explain...  Can anyone please explain, What is 403 Forbidden error. And how can i remove this error, which is restricting my page from loading it. Thanks!!   Ok
Can someone review my script for an apparent parsing error? -it isn't quite finished yet, but I want to fix error first
Can someone review my script for an apparent parsing error? -it isn't quite finished yet, but I want to fix error first   import java.util.Scanner; class historyquiz{ public static void main(String args
infix to post fix convertion
infix to post fix convertion  a+(bc-(d/e^f))*h
Version of com.intersult>jpa-fix dependency
List of Version of com.intersult>jpa-fix dependency
How to fix java.lang.UnsupportedClassVersionError: Unsupported major.minor version
error: Unsupported major.minor version 51.0 How to fix java.lang.UnsupportedClassVersionError: Unsupported major.minor version? thanks   Hi, Error...How to fix java.lang.UnsupportedClassVersionError: Unsupported major.minor
Error-
Error-   Hello, I would like to know about XSD file. I try to print XML file but I am getting error SAXException-- says Content is not allowed in prolog. Please help me
error
/ServletUserEnquiryForm.shtml getting an error given below SQLException caught: [Microsoft][ODBC SQL Server Driver]COUNT field incorrect or syntax error please suggest
Error
state then city will not come in dropdown list and it give me error as 'Unknown Runtime Error'. This error come only in IE browser, but in other brower it shows me proper output. Please anybosy can give me remedy on that..... Thank you
error
error  java.lang.unsupportedclassversionerror:bad major version at offset 6 how to solve this????   Hi, Please check the version of framework used and also the JDK version. This type error also comes when java file
error
error  When I deploye the example I have this message cannot Deploy HelloWorld Deployment Error for module: HelloWorld: Error occurred during...://java.sun.com/xml/ns/javaee'.. Please see server.log for more details. please help me
Maven Dependency jpa-fix >> 1.1
You should include the dependency code given in this page to add Maven Dependency of com.intersult >> jpa-fix version1.1 in your project
Error
Error  Hi. I am getting error in the following code after the line I have commented as ERROR. How to solve this. Thanks in advance. package...=='')"); out.println(" {"); out.println(" alert('Please enter the Father Name
Error
Error  Hi. I am getting error in the following code after the line I have commented as ERROR. How to solve this. Thanks in advance. package...=='')"); out.println(" {"); out.println(" alert('Please enter
Error
Error  Hi. I am getting error in the following code after the line I have commented as ERROR. How to solve this. Thanks in advance. package...=='')"); out.println(" {"); out.println(" alert('Please enter
Error
Error  Hi. I am getting error in the following code after the line I have commented as ERROR. How to solve this. Thanks in advance. package...=='')"); out.println(" {"); out.println(" alert('Please enter
error
error  while iam compiling iam getting expected error
error
error  i have 404 error in my program plz tell me yhe solution about
error
error  i have 404 error in my program plz tell me yhe solution about