Solved

JAVA, CLoudScape - Prepared Statements

Posted on 2006-11-02
4
295 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 175 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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

For customizing the look of your lightweight component and making it look opaque like it was made of plastic.  This tip assumes your component to be of rectangular shape and completely opaque.   (CODE)
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…

760 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now