Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

JAVA, CLoudScape - Prepared Statements

Posted on 2006-11-02
4
Medium Priority
?
328 Views
Last Modified: 2008-03-17
Hi,

I am receiving the following error when I compile my Java Program.

exception thrown:
SQL Exception: Lexical error at line 1, column 38. Encountered: "\u20ac" (8364), after : "".


I am trying to use this:                         

s.execute("CREATE STATEMENT SPS1 AS INSERT INTO Shipment VALUES(?,?,?,?,?,?)");
s.executeUpdate("EXECUTE STATEMENT SPS1 USING VALUES(‘Test’, ‘s102’, ‘2004-10-12’, 1.0, 10.0, 10.0)");

(Statement s = conn.createStatement();) <--- This is just so you know that s has been declared.


Regards,
Pete
0
Comment
Question by:pete420
  • 2
4 Comments
 
LVL 92

Expert Comment

by:objects
ID: 17863498
are the openinf and closing quotes the same character?
0
 
LVL 16

Accepted Solution

by:
suprapto45 earned 700 total points
ID: 17864214
As far as I know,

\u20ac is the EURO symbol. It is a kind of weird why it complains that problem.

Anyway, try to replace your single quote with the *normal* quote. You may copy and paste it from Microsoft Word.
>>"EXECUTE STATEMENT SPS1 USING VALUES(‘Test’, ‘s102’, ‘2004-10-12’, 1.0, 10.0, 10.0)"
should be
EXECUTE STATEMENT SPS1 USING VALUES('Test', 's102', '2004-10-12', 1.0, 10.0, 10.0)
0
 

Author Comment

by:pete420
ID: 17865601
Can't believe it was that simple a mistake.

I was using ` ` instead of ' '.

Thanks for the help.
0
 
LVL 16

Expert Comment

by:suprapto45
ID: 17873646
Glad I could help

David
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
In this post we will learn different types of Android Layout and some basics of an Android App.
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
Suggested Courses

876 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question