List:MySQL and Java« Previous MessageNext Message »
From:Jonathan Baxter Date:February 11 2003 4:45am
Subject:Re: Blobs and SQL Locator
View as plain text  
Can getBytes be implemented efficiently without locators? That would 
be a start for me. I couldn't find anything in any of the mysql apis 
that would allow one to getBytes from inside a Blob without pulling 
the whole Blob to the client side, but maybe I missed something. 

Its not an option for me to pull the Blobs to client memory - they're 
too big. 

At present, I get around this by dumping the Blob to a networked disk 
on the server side with "select into dumpfile", then mmap the blob on 
the client side and do my thing on its innards, and then "replace 
into .... set blob_column=load_file" on the server again. This avoids 
storing the entire Blob in memory on the client, but still requires 2 
reads and 2 writes of the entire Blob to disk on the server. 

Thanks, 

Jonathan

On Tuesday 11 February 2003 13:44, you wrote:
> Jonathan Baxter wrote:
> > Are there any plans for a complete implementation of Blob in the
> > Connector/J package? Specifically, getBytes and setBytes?
> >
> > I could find no reference to any plans for SQL Locators on the
> > MySQL web-site, without which we're not likely to get the full
> > Blob either.
> >
> > Cheers,
> >
> > Jonathan
>
> Until the server itself supports locators, setBytes() can't be
> implemented efficiently. It is possible for Connector/J to
> implement this, if there is enough interest (I can put it on my
> feature list for 3.1). However, you'll still have to pass the Blob
> instance back into an updatable result set, or a PreparedStatement
> to persist it. This is still JDBC-compliant, as DatabaseMetaData
> returns true for locatorsUpdateCopy().
>
> 	-Mark

-- 
Jonathan Baxter, CEO
Panscient Pty Ltd
Phone: +61 412 204 148
jbaxter@stripped

Thread
Re: JDBC Interface for Embedded Server ?Nigel Wetters6 Feb
  • RE: JDBC Interface for Embedded Server ?Shankar Unni7 Feb
    • Re: JDBC Interface for Embedded Server ?Mark Matthews9 Feb
    • Blobs and SQL LocatorJonathan Baxter9 Feb
      • Re: Blobs and SQL LocatorMark Matthews11 Feb
        • Re: Blobs and SQL LocatorJonathan Baxter11 Feb
  • RE: JDBC Interface for Embedded Server ?Peter Schäfer8 Feb