• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

jsp error

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
jsp code following
<html>
<head><title>Getting totalamount</title></head>
<%@ page import="java.sql.*" %>
<%@ page import="java.util.Date.*" %>
<%@ page import="java.util.*" %>
<%@ page import= "java.SimpleDateFormat" %>
<%@ page import =java.text.DateFormat" %>
<body>

<body>

<%

String start_date = request.getParameter("begindate");
String end_date = request.getParameter("enddate");
SimpleDateFormat sdf = java.text.SimpleDateFormat("dd/MM/yyyy");
java.util.Date d = sdf.parse(start_date);
java.utildate e =sdf.parse(end_date);

java.sql.Date startdate = new java.sql.Date(d);
java.sql.Date enddate = new java.sql.Date(e);





Class.forName("oracle.jdbc.driver.OracleDriver");
Connection conn = DriverManager.getConnection("jdbc:oracle:thin:@toshiba-user:1521:orcl","wara","kali");

Statement stmt = conn.createStatement();
ResultSet rs = stmt.executeQuery(" SELECT SUM(sale)total FROM DAILYSALE WHERE saledate BETWEEN startdate AND enddate " );

while (rs.next()) {
int result = rs.getInt("total"); %>
<%= result %>

<% }


conn.close();
stmt.close();


%>
</body>
</html>
When i input fields of html form to run the jsp i get error:jasperException sales.jsp(6 18) qoute symbol expected.
Please help me to solve this.
 
Sheriff
Posts: 67747
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

jasperException sales.jsp(6 18) qoute symbol expected.



How much clearer can it be? It's giving you the line number and column position where you forgot a quote character.

P.S. Please be sure to use UBB code tags when posting code; read this for more information.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic