Right now, I just have the basic configuration going on, and am applying
the credentials to the connection later, so my SqlMapClient creation
isn't anything special.

My SqlMapConfig.xml contains the following:

        <transactionManager type="EXTERNAL" >
                <dataSource type="JNDI">
                        <property name="DBJndiContext"
value="java:comp/env/jdbc/zimbubnk" />
                </dataSource>
        </transactionManager> 


And I'm creating the SqlMapClient with the following code:

Reader reader = 
        Resources.getResourceAsReader
(
        "/com/nm/ecc/persistence/data/singletable/SqlMapConfig.xml"
);

SqlMapClient sqlMap = SqlMapClientBuilder.buildSqlMapClient(reader);


-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf
Of Larry Meadors
Sent: Wednesday, May 16, 2007 10:15 PM
To: [email protected]
Subject: Re: Setting username and password credentials for JNDI
datasource

How are you creating your sql map client?

Larry


On 5/16/07, [EMAIL PROTECTED]
<[EMAIL PROTECTED]> wrote:
>
>
>
> My DataSources need to have their Connection's username and password
> credentials set programmatically at runtime.  Unfortunately, for a few
> reasons, configuring them at the server level is not an option.
>
> The most recent postings I was able to find on this subject were from
2005,
> so I wanted to put this message out there again, in case there is a
solution
> supported in iBATIS now, or at least an elegant workaround, that
someone
> else has found.
>
> I am able to do the following in Hibernate, and am looking for the
> equivalent way to accomplish this in iBATIS:
>
>     Configuration config = new
> Configuration().configure("hibernate.cfg.xml");
>     config.setProperty("hibernate.connection.username", "username");
>     config.setProperty("hibernate.connection.password", "password");
>
> thanks
> - Russ
>
>  This e-mail and any attachments may contain confidential information
of
> Northwestern Mutual. If you are not the intended recipient of this
message,
> be aware that any disclosure, copying, distribution or use of this
e-mail
> and any attachments is prohibited. If you have received this e-mail in
> error, please notify Northwestern Mutual immediately by returning it
to the
> sender and delete all copies from your system. Please be advised that
> communications received via the Northwestern Mutual Secure Message
Center
> are secure. Communications that are not received via the Northwestern
Mutual
> Secure Message Center may not be secure and could be observed by a
third
> party. Thank you for your cooperation.
>
>

This e-mail and any attachments may contain confidential information of 
Northwestern Mutual. If you are not the intended recipient of this message, be 
aware that any disclosure, copying, distribution or use of this e-mail and any 
attachments is prohibited. If you have received this e-mail in error, please 
notify Northwestern Mutual immediately by returning it to the sender and delete 
all copies from your system. Please be advised that communications received via 
the Northwestern Mutual Secure Message Center are secure. Communications that 
are not received via the Northwestern Mutual Secure Message Center may not be 
secure and could be observed by a third party. Thank you for your cooperation.

Reply via email to