Antw: Re: Get Connection out of EOEditingContext or EOObjectStoreCoordinator [WO5.2.4]
"COAST" <[email protected]>
| Newsgroups | gmane.comp.web.webobjects.devel |
|---|---|
| Message-ID | <[email protected]> |
Thanks to Patrick and Garry
here the snippet how it works:
EOModel model = EOModelGroup.defaultGroup().modelNamed("MyModelName");
EODatabaseContext myEODatabaseContext =
EODatabaseContext.registeredDatabaseContextForModel(model, this.editingContext());
JDBCContext myJDBCContext = (JDBCContext)myEODatabaseContext.adaptorContext(); // the "bridge" I was looking for
Connection con = myJDBCContext.connection();
Peter
Greetings from Switzerland
>>> Patrick Middleton <[email protected]> 12.04.2006 17:37:05 >>>
On 12 Apr 2006, at 15:30, COAST wrote:
> Hi List
>
> how can you get the Connection (java.sql.DriverManager.getConnection
> ()) out of
> EOEditingContext or EOObjectStoreCoordinator or ...
>
> We need the Connection cause we want to stream BLOB's in / out of
> ORACLE.
> It seems that NSData isn't streaming BLOB's in / out of ORACLE but
> the following code is doing so:
> ...
connection() in com.webobjects.jdbcadaptor.JDBCContext .
JDBCContext is a subclass of EOAdaptorContext. Obtain an instance by
[1] public static EODatabaseContext registeredDatabaseContextForModel
(EOModel model, EOEditingContext editingContext)
[2] public EOAdaptorContext adaptorContext()
Hope this helps!
-- Patrick
_______________________________________________
WebObjects-dev mailing list
[email protected]
http://www.omnigroup.com/mailman/listinfo/webobjects-dev
_______________________________________________
WebObjects-dev mailing list
[email protected]
http://www.omnigroup.com/mailman/listinfo/webobjects-dev