Solved

JAVA, CLoudScape - Prepared Statements

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

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

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

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…
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
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…
The viewer will learn how to implement Singleton Design Pattern in Java.
Suggested Courses

752 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