Re: how to set username/password ?

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Tue Mar 04 2003 - 21:50:32 EST

  • Next message: Andriy Shapochka: "Re: Key generator question"

    Jean,

    another "bright" idea how to implement password checking, and still use
    shared Cayenne connection pool (if you are still persuing that, and if I
    understand correctly what you are trying to achieve).

    You may implement your own DataContext factory class, with a method like:

    public DataContext createDataContext(String userName, Stirng password);

    and internally match login/password that was used for the original
    connection (even though the connection is already open), with the one
    supplied. If they match, return DataContext, if not - throw some knid of
    security exception.

    The original values of login/password can be obtained like that:

    DataDomain domain = Configuration.getDomain();
    DataNode node = (DataNode)domain.getDataNodes().get(0);
    PoolManager pool = (PoolManager)node .getDataSource();
    String userName = pool.getUserName();
    String password = pool.getPassword();

    Andrus



    This archive was generated by hypermail 2.0.0 : Tue Mar 04 2003 - 21:52:07 EST