You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Chen Chunwei <ou...@cn.panasonic.com> on 2008/03/27 09:12:02 UTC

How to use in your own java file?

Hi all,

I've already configured a <data-source> in struts-config.xml through some reference. But I don't know how to use it in my own business logic.

Talos

Re: How to use in your own java file?

Posted by Chen Chunwei <ou...@cn.panasonic.com>.
Thanks Antonio

I will try it.

Talos

----- Original Message ----- 
From: "Antonio Petrelli" <an...@gmail.com>
To: "Struts Users Mailing List" <us...@struts.apache.org>
Sent: Thursday, March 27, 2008 4:23 PM
Subject: Re: How to use <data-source> in your own java file?


2008/3/27, Chen Chunwei <ou...@cn.panasonic.com>:
>  I've already configured a <data-source> in struts-config.xml through some reference. But I don't know how to use it in my own business logic.

Use the "getDataSource" method in your action. Anyway, notice that it
is discouraged to use a data source this way. It is better to use JNDI
to take it from the container.

Antonio

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org

Re: How to use in your own java file?

Posted by Antonio Petrelli <an...@gmail.com>.
2008/3/27, Chen Chunwei <ou...@cn.panasonic.com>:
>  I've already configured a <data-source> in struts-config.xml through some reference. But I don't know how to use it in my own business logic.

Use the "getDataSource" method in your action. Anyway, notice that it
is discouraged to use a data source this way. It is better to use JNDI
to take it from the container.

Antonio

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org