Solved

JAVA, CLoudScape - Prepared Statements

Posted on 2006-11-02
4
315 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
Suggested Courses

623 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