Hamid Amjadi wrote:

Hi ;


 I am usein the following prepared statement:

insertOne = dbConnection.prepareStatement( "INSERT INTO appointment
(apptId,providerId,patientId,serviceLocationId, dateTime, assistant,
duration,state,statechange,memo,cancelMemo,dictationMarked, apptSeqId,
clinicId, appSharing) values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)" );


If there is a "'" in any of the data field that is defined as char
i am getting the following errors:
ERROR EXCEPTION: [java.sql.SQLException: Syntax error or access
violation:

and in the field memo data looks like this:

 'PT'S MOTHER COMPLAINED AND REQUESTED THROAT'

The versin of the MYSQL i use is 3.22.32 . Operating System is AIX
4.3.3.

What version of the JDBC driver are you using? It looks like it's probably a _very_ old one. Either that, or you're escaping the strings before sending them to the .setString() method of PreparedStatement (which takes care of the escaping for you).

-Mark

--
For technical support contracts, visit https://order.mysql.com/?ref=mmma

__ ___ ___ ____ __
/ |/ /_ __/ __/ __ \/ / Mark Matthews <[EMAIL PROTECTED]>
/ /|_/ / // /\ \/ /_/ / /__ MySQL AB, Full-Time Developer - JDBC/Java
/_/ /_/\_, /___/\___\_\___/ Flossmoor (Chicago), IL USA
<___/ www.mysql.com


---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to