• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: How can I stream blobs to/from entities?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How can I stream blobs to/from entities?


  • Subject: Re: How can I stream blobs to/from entities?
  • From: Jonathan Rochkind <email@hidden>
  • Date: Mon, 12 Apr 2004 15:29:32 -0500

I don't believe EOF supports that, unfortunately. You need to do it with JDBC API directly. Don't model the myBlobAttribute at all, but perhaps write those methods to use JDBC API to do what you want, by referencing the primary key of the EO to make sure you are getting/setting from the right row.

I'm not familiar with JDBC API myself, so I don't know how to do this, but I believe it's possible to stream to/from the db wtih JDBC. If it's not... then you are doubly out of luck.

--Jonathan

At 4:03 PM -0400 4/12/04, Serge Froment wrote:
Hi,

In a WebObjects 5.2 project, I need to store large blobs of data in a database and my web application needs to let the user upload/download those. I want to code accessors for my entity that use InputStream/OutputStream instead of NSData so the data will not fill up memory.

class MyEntity extends EOEnterpriseObject
{
    (...)
    public InputStream myBlobAttribute()
    {
        (...)
    }
    public void setMyBlobAttribute(OutputStream stream)
    {
        (...)
    }
}

What I need to know is how I can connect to the database using a java.sql.Connection instance to stream the data to/from the database. I don't want to create a new connection each time because establishing a new connection is costly, but I can't figure out how I can reach the existing connection that WebObjects maintains and use it in an EOF-friendly manner.

Serge Froment
http://www.serge-froment.com
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.


  • Follow-Ups:
    • Re: How can I stream blobs to/from entities?
      • From: Serge Froment <email@hidden>
References: 
 >How can I stream blobs to/from entities? (From: Serge Froment <email@hidden>)

  • Prev by Date: Editing a record
  • Next by Date: Re: How can I stream blobs to/from entities?
  • Previous by thread: How can I stream blobs to/from entities?
  • Next by thread: Re: How can I stream blobs to/from entities?
  • Index(es):
    • Date
    • Thread