Re: username/password in node xml definition

From: Cris Daniluk (cris.danilu..mail.com)
Date: Sat Feb 18 2006 - 21:06:47 EST

  • Next message: Todd O'Bryan: "Validation error that shouldn't be (I don't think)"

    > Why is this? I've read a bit about JNDI - very little, I'll admit - but
    > haven't learned anything that would obviouly eliminate it as a possible
    > solution, aside from the fact that adding yet another new technology (new =
    > I haven't used it before on a project) would add too heavy a burden to the
    > work still left.
    >
    It shouldn't... you don't need to change anything in your app, since
    you're using Cayenne and Cayenne is cool like that :) Just add a new
    DataNode in the Modeler, use the JDNIDataSourceFactory, and point it
    to the JNDI name you have created in server.xml (if using Tomcat, if
    not - the name you have created however you do it in your particular
    server)

    The reason that you "should use JNDI" is because the theory is that
    the guy configuring the production environment - tomcat, database, etc
    - doesn't know Java and wouldn't begin to know where to set database
    settings in your app, but with JNDI, he can just define the resource
    in the app server. Honestly, I don't use it as often as I should...

    > > * use custom DataSourceFactory that pops up a login dialog for
    > > desktop apps
    >
    > Ideally, I'd like noone except a server root to have access to the database
    > login info. In that respect, JNDI seemed a natural solution: let's put all
    > the application-level login information into a, say, LDAP directory, and
    > allow identified users to get an already initialized DataSource...or
    > something like that. :)
    >
    > t.n.a.
    >
    Just to be clear, JNDI doesn't require LDAP... LDAP certainly can
    provide the database connection information, but really you just need
    to ensure that your production Tomcat deployment has the datasource
    defined, and that you make the server.xml owned only by root (if you
    really want it only accessible to root).

    It might require some tweaking for you to get it right the first time,
    but it shouldn't be too difficult - really, there's less than 10 lines
    of configuration that you need to do, and if you use the Tomcat admin
    app and the Cayenne modeler, there's just clicking!

    Cris



    This archive was generated by hypermail 2.0.0 : Sat Feb 18 2006 - 21:06:50 EST