473,473 Members | 2,031 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

ERROR: String literal not properly closed by a double quote

1 New Member
this is a query which works in mysql but does not work in the jsp
Expand|Select|Wrap|Line Numbers
  1. SELECT (@rownum:=@rownum+1) AS pos, fname,lastname,othername,clas,(( tblbot.mtc+tblmot.mtc+tbleot.mtc)/3+ 
  2. (tblbot.eng+tblmot.eng+tbleot.eng)/3 + (tblbot.che+tblmot.che+tbleot.che)/3+
  3. (tblbot.bio+tblmot.bio+tbleot.bio)/3 + (tblbot.phy+tblmot.phy+tbleot.phy)/3+ 
  4. (tblbot.agr+tblmot.agr+tbleot.agr)/3+(tblbot.his+tblmot.his+tbleot.his)/3+ 
  5. (tblbot.fat+tblmot.fat+tbleot.fat)/3+( tblbot.geo+tblmot.geo+tbleot.geo )/3+ 
  6. (tblbot.cre+tblmot.cre+tbleot.cre)/3+ (tblbot.kis+tblmot.kis+tbleot.kis)/3+ 
  7. (tblbot.fre+tblmot.fre+tbleot.fre )/3+(tblbot.lug+tblmot.lug+tbleot.lug )/3+ 
  8. (tblbot.ent+tblmot.ent+tbleot.ent)/3+ (tblbot.com+tblmot.com+tbleot.com)/3 ) AS tot  
  9. FROM tblemp_dtai LEFT JOIN tblbot ON tblbot.employee_id  LEFT JOIN tblmot ON
  10.  tblmot.employee_id LEFT JOIN tbleot ON tbleot.employee_id, (SELECT @rownum:=0) r WHERE 
  11.  tblemp_dtai.employee_id = tblbot.employee_id AND 
  12.  tblemp_dtai.employee_id = tblmot.employee_id AND 
  13.  tblemp_dtai.employee_id = tbleot.employee_id AND clas = 'S.1' ORDER BY tot DESC;
i am new to this sit i have a problem, my query works in mysql but fails in the jsp file reporting an error; String literal not properly clsoed by a double help

regards
Thanks in advance
Mar 30 '13 #1
1 4557
r035198x
13,262 MVP
Most likely you haven't enclosed your SQL in the " quotes properly.

1.) Separate your Java code from your HTML by using a separate Java class to execute the SQL rather than the JSP.
2.) Use a PreparedStatement for the building the query.
Mar 30 '13 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Diarmaid McGleenan | last post by:
Hi all. This isn't quite the same single/double-quote problem we see posted a multitude of times in this ng. Read on... I have a js function called ShowActiveLink which accepts a string...
7
by: herrcho | last post by:
i'm in the course of learning C, and found these two words "string, string literal" confusing me.. I'd like to know the difference between them.. Thank you
7
by: al | last post by:
char s = "This string literal"; or char *s= "This string literal"; Both define a string literal. Both suppose to be read-only and not to be modified according to Standard. And both have...
4
by: songkv | last post by:
Hi, I am trying to reassign an array of char to a string literal by calling a function. In the function I use pointer-to-pointer since I want to reassign the "string array pointer" to the string...
9
by: Bob M | last post by:
If I define an expression or equation, how can I retrieve that expression as string literal? I want to do this so that I could avoid repetitive typing (or copy/paste/change) the same thing at two...
8
by: xmllmx | last post by:
It seems true, but I can't find any exact statement on this in the C or C++ standard. The C and C++ standard states: "__FILE_ The presumed name of the source file (a character string...
5
by: polas | last post by:
Good morning, I have a quick question to clear up some confusion in my mind. I understand that using a string literal in a declaration such as char *p = "string literal" declares a pointer to...
2
by: h03Ein | last post by:
Hi! during my search on tokens in ANSI C I have found following specification for string literals based on regular expression in site http://www.lysator.liu.se/c/ANSI-C-grammar-l.html :...
3
by: Dave Pylatuk | last post by:
Hello, I am getting the above error when executing a large insert statement against 8.1.7. This insert statement includes a very large string value, about 8000 characters long. Is there a limit...
4
by: zaimoni | last post by:
I've already calculated that the following are valid and should not error, as both just end up with the character literal 'A' being their control expression. The unspecified value of the char*...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.