Re: JDBC and CLOB retrieval question



Arne Vajhøj wrote:
Martin Gregorie wrote:
Peter Fourneau wrote:
if you work with a Clob:
I tried to avoid using Clob because that chews up memory if you're using large amounts of data and Clobs could be multi-megabytes on occasion.

The whole point of Clob is that it avoids reading the entire object
into memory.

Thats the case if you're moving it through a Stream as some functions do. My problem is that I need to shift it between a TEXT (the nearest Postgres has to a CLOB and the content field in a JavaMail Message or Part (a byte array). If I do a quick and dirty conversion via standard objects it looks like I'd need to go through a String or StringBuffer.

Looks like I'd best extend the MimeMessage and MimePart objects to let be do byte <-> char at a time conversions.

Luckily I've been away doing other things and thinking over this problem in idle moments. At least now I have a better idea of which way I need to go. I'll report back once I've worked on it.


--
martin@ | Martin Gregorie
gregorie. | Essex, UK
org |
.



Relevant Pages

  • Re: checking if text has changed
    ... clob. ... if the sql didn't return any rows, then i know that somebody change the ... When the user tries the save the data, you read the record again and compare what's held in memory against what was just read. ...
    (comp.programming)
  • ODBC SQLCloseCursor or SQLFreeHandle does not free the memory of CLOB field in Oracle.
    ... I am using a C++ application that connects to Oracle Database using ... EasySoft ODBC driver. ... I face a strange problem when freeing the memory after i fetch the CLOB ...
    (comp.databases.oracle.misc)
  • ODBC SQLCloseCursor or SQLFreeHandle does not free the memory of CLOB field in Oracle.
    ... I am using a C++ application that connects to Oracle Database using EasySoft ODBC driver. ... I face a strange problem when freeing the memory after i fetch the CLOB data from the Oracle table. ... Still i am seeing the memory usage is exactly increasing by 10 MB(size of the buffer we allocated to read the CLOB) for each query. ...
    (microsoft.public.data.odbc)
  • Re: JDBC and CLOB retrieval question
    ... That's the Postgres equivalent of a CLOB. ... private String retrieveText ... martin@ | Martin Gregorie ... } catch (IOException e) { ...
    (comp.lang.java.programmer)
  • Re: JDBC and CLOB retrieval question
    ... I tried to avoid using Clob because that chews up memory if you're using large amounts of data and Clobs could be multi-megabytes on occasion. ...
    (comp.lang.java.programmer)