Hi everybody,
I'm having a problem where the JDBC driver probably means well but is
not doing what I want.
I need to store data in a database which will at a later time be sent on
to a servlet in XML format. Some characters need to be given their
special XML format, for example if I want to transmit the ampersand (&)
sign, I need to pass along the code & instead of just &.
So what happens is my app parses user input, replaces all special signs
like & with their XML counterparts and then I try to store these in
MySQL. However, when I do the INSERT into MySQL, the & sign is
stored in MySQL as & which then causes me problems when I want to send
this data on to the servlet.
Therefore my question is, how do I get MySQL to store the &
character sequence without it being "intelligent" and changing it to the &
sign?
Thanks very much for your help,
Jonck
P.S. using MySQL 4.0.20-standard and the mysql-connector-java-3.0.14-
production
Gregory Toomey - 25 Oct 2004 19:28 GMT
> Hi everybody,
> I'm having a problem where the JDBC driver probably means well but is
[quoted text clipped - 18 lines]
> P.S. using MySQL 4.0.20-standard and the mysql-connector-java-3.0.14-
> production
What are you on about? Mysql stores '&' as '&' and '&' as '&&;' like
all other relational databases.
gtoomey
Jonck - 26 Oct 2004 02:34 GMT
> What are you on about? Mysql stores '&' as '&' and '&' as '&&;'
> like all other relational databases.
>
> gtoomey
Sorry, my wrong, the character sequence was being interpreted by an XML
parser and that was what was the cause of the & character (and other
such characters) to get translated to the & sign, it was indeed not the
database that was to blame here.
Thanks for putting me in the right, Jonck
_Mario_ - 26 Oct 2004 09:14 GMT
> Hi everybody,
> I'm having a problem where the JDBC driver probably means well but is
[quoted text clipped - 9 lines]
> stored in MySQL as & which then causes me problems when I want to send
> this data on to the servlet.
...what about doing an enchode URL or a Decode URL?
Mario