| Register | FAQ | Calendar | Search | Today's Posts | Mark Forums Read |
|
#1
| |||
| |||
| 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 |
|
#2
| |||
| |||
| Jonck wrote: > 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 What are you on about? Mysql stores '&' as '&' and '&' as '&&;' like all other relational databases. gtoomey |
|
#3
| |||
| |||
| > 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 |
|
#4
| |||
| |||
| "Jonck" <jonck@vanderkogel.net> wrote in message news:20041025172047789+0200@news.text.chello.nl... > 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. ....what about doing an enchode URL or a Decode URL? Mario |
![]() |
| Thread Tools | |
| Display Modes | |
In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.