• 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: Determining database plugin at runtime
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Determining database plugin at runtime


  • Subject: Re: Determining database plugin at runtime
  • From: Matthew Ness <email@hidden>
  • Date: Sun, 31 Mar 2013 08:03:20 +1100



EOModelGroup group = EOModelGroup.defaultGroup();
EOModel model = group.modelNamed("YourModel");
EOAdaptor ad = EOAdaptor.adaptorWithModel(model);
log.debug("adaptor cd:"+ad.connectionDictionary());
log.debug("adaptor pi:"+ad.plugInName());



On 31/03/2013, at 6:15 AM, Klaus Berkling wrote:


On Mar 29, 2013, at 11:36 PM, Paul Hoadley <email@hidden> wrote:

I (think I) want to determine what plugin is in use for a particular model at runtime.  What's the easiest way?  (I see EOAdaptor.pluginName(), but, somewhat embarrassingly, I can't quite work out how to get the EOAdaptor object for a model.)

How about looking at the jdbc URL:

dbConnectURLGLOBAL= jdbc:h2:file:...
dbConnectURLGLOBAL=jdbc:mysql:...
dbConnectURLGLOBAL==jdbc:oracle:

(This relates to my recent thread "Disable constraint checking under H2".  I want to do exactly that: at runtime, if the H2 plugin is in use, I'll run "SET REFERENTIAL_INTEGRITY FALSE;".  If anyone can suggest a better way to do that conditional on running H2, I'm all ears.)



kib

"The essence of training is to allow error without consequence."
Orson Scott Card

Klaus Berkling
Web Application Dev. & Systems Admin
DynEd International, Inc.
www.dyned.com

-- 
Matt.

http://logicsquad.net/


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Determining database plugin at runtime
      • From: Paul Hoadley <email@hidden>
References: 
 >Determining database plugin at runtime (From: Paul Hoadley <email@hidden>)

  • Prev by Date: Re: Weird problem with D2W rules
  • Next by Date: Re: Weird problem with D2W rules
  • Previous by thread: Determining database plugin at runtime
  • Next by thread: Re: Determining database plugin at runtime
  • Index(es):
    • Date
    • Thread