5 messages in com.mysql.lists.javaRE: String with " charatchter fails i...| From | Sent On | Attachments |
|---|---|---|
| Paul Foxton | 14 Sep 2001 08:15 | |
| Ylan Segal | 14 Sep 2001 09:10 | |
| Paul Foxton | 14 Sep 2001 09:40 | |
| Ylan Segal | 14 Sep 2001 10:25 | |
| Ylan Segal | 14 Sep 2001 12:13 |
| Subject: | RE: String with " charatchter fails is truncated on INSERT![]() |
|---|---|
| From: | Paul Foxton (pa...@network-sol.com) |
| Date: | 09/14/2001 08:15:43 AM |
| List: | com.mysql.lists.java |
hope this isn't too obvious a question, but are you using the backslash escape character before your " ?
ie INSERT INTO table_name VALUES ('null', 'blah blah \"blah\" blah');
-----Original Message----- From: Ylan Segal [mailto:yl...@digiworks.tv] Sent: 14 September 2001 17:10 To: ja...@lists.mysql.com Subject: String with " charatchter fails is truncated on INSERT
My problem is as follows:
I have developed a web-application using tomcat and mysql. The problem is that Strings that contain the character " (double-quote) are not being stored properly in mysql, what is happening is that the String is being truncated at the first appearens of the " character.
Now, if I print the String to console or web-page the Strig is NOT truncated and it is properly displayed. I am pretty sure the problem lays in the INSERT statement.
I am using mm.mysql latest drivers. My code looks like this:
..... String query = "INSERT INTO MyTable VALUES(NULL, ?)"; //The null is for an autoincrement field and second field is a VARCHAR field. PreparedStatement = con.prepareStatement(query); //con is a java.sql.Connection ps.setString(1, myString); //my String is the string with the " charachter. int count = ps.executeUpdate(); .....
Is this a problem with the driver that is not escaping the " character properly? Does anybody have a solution?
Thanks a lot for your help.
_____
--------------------------------------------------------------------- Please check
"http://www.mysql.com/Manual_chapter/manual_toc.html" before posting. To request this thread, e-mail java...@lists.mysql.com
To unsubscribe, send a message to the address shown in the List-Unsubscribe header of this message. If you cannot see it, e-mail java...@lists.mysql.com instead.




