dcsimg
How to use connections from connection the pool obtained by data-source declaration in Struts-config.xml ?
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Cotton_Gear
Posted On:   Monday, December 23, 2002 01:49 AM

I need to use the connections obtained through declarations in struts-config.xml
Please provide me the sysntax or examples to use the connections from the pool obtained through " "
declaration.

Thanks in advance,
Sujith

Re: How to use connections from connection the pool obtained by data-source declaration in Struts-config.xml ?

Posted By:   chocks_karapagavinayagam  
Posted On:   Tuesday, December 24, 2002 02:45 AM


Hi

I think the below two steps will help you to establish the connection to the database.

Step 1

The data-source decleration in your struts-config goes like this












I've used scott/tiger for the username and password respectively.
Do provide the appropriate value for the following
username
password
localhost or your ip address
SID

Step 2

In your Action Class do add the following code

Connection myConnection=null;
javax.sql.DataSource dataSource;

dataSource = getDataSource(request);
myConnection = dataSource.getConnection();


Hope this helps you
cheers
chocks
About | Sitemap | Contact