Solved

JAVA, CLoudScape - Prepared Statements

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

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

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

Suggested Solutions

After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
The viewer will learn how to implement Singleton Design Pattern in Java.
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

773 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