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



Home Answers Viewqa JSP-Servlet please fix the error
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


hello
please fix the error
1 Answer(s)      2 years and 9 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);
    }

%>

Advertisement
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);
}

%>


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
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
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
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
infix to post fix convertion
infix to post fix convertion  a+(bc-(d/e^f))*h
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
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
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
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
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
error
error
java please please help
java please please help  Dear Friends plz help me to complete this program import java.util.*; public class StringDemo { static String a="{a=100;b=200;c=300}"; public static void main(String args
where do I find the fix for tree view catalog not expanding and collapsing correctly for roseindia shopping cart 1.1
where do I find the fix for tree view catalog not expanding and collapsing correctly for roseindia shopping cart 1.1  where do I find the fix for tree view catalog not expanding and collapsing correctly for roseindia shopping
error!!!!!!!!!
error!!!!!!!!!   st=con.createStatement(); int a=Integer.parseInt(txttrno.getText()); String b=txttname.getText(); String c=txtfrom.getText(); String d=txtto.getText
 

 

 

DMCA.com