Storing a very long string in a database
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   adam_gernon
Posted On:   Friday, March 8, 2002 04:08 AM

We have a 3rd party component (a janus grid) on a v.b. form which is base64 encoded (into a string format) and passed over the wire through xml to a java servlet which writes it to the Oraclce 8.1.5. database. In theory this is fine but what we write to the database is not what we get back, I have tried using a byte array, a clob object and a LONG field but all of these result in what looks like an extra endline character (chr(10)) being written to the database on each line. What I believe could be the problem is that the jdbc driver could be doing this as when I do the same insert/update from the SQLPlus app I do not get the end lines inserted into the database. We know for definite that it is the database that is the problem as we have don   More>>

We have a 3rd party component (a janus grid) on a v.b. form which is base64 encoded (into a string format) and passed over the wire through xml to a java servlet which writes it to the Oraclce 8.1.5. database.
In theory this is fine but what we write to the database is not what we get back, I have tried using a byte array, a clob object and a LONG field but all of these result in what looks like an extra endline character (chr(10)) being written to the database on each line.


What I believe could be the problem is that the jdbc driver could be doing this as when I do the same insert/update from the SQLPlus app I do not get the end lines inserted into the database. We know for definite that it is the database that is the problem as we have done extensive analysis on all points of failure e.g. encoding/decoding/xml/serverside etc. and it has to be the db.



Does anyone have any ideas as I am completely stumped.



regards,



and thanks in advance

adam    <<Less

Re: Storing a very long string in a database

Posted By:   Christopher_Schultz  
Posted On:   Friday, March 8, 2002 05:25 AM

So, you are saying that you insert a super-long string into your database, and no matter what column type you use, you get mysterious '\000a' characters in essentially random places?



Especially if you use a BLOB, you should never get any byte translation when writing to the database.



Are there newlines in the XML stream that you are sending to the servlet, or is the whole thing on one, single line?



Is it possible that Java is doing the translation from
to
and that's the source of the problem?



-chris
About | Sitemap | Contact