Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

value of DATA_SOURCE_KEY field in Action class

 
siva prakash
Ranch Hand
Posts: 80
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

if I define more than one datasource in struts-config.xml without specifying key attribute, which value will be stored in Action.DATA_SOURCE_KEY field.

example :

<data-sources>
<data-source
autoCommit="false"
description="First Database Config"
driverClass=" org.gjt.mm.mysql.Driver"
maxCount="4"
minCount="2"
password="admin"
url="jdbc:mysql://localhost/ARTICLEDB"
user="admin"
/>
<data-source
autoCommit="false"
description="Second Database Config"
driverClass="oracle.jdbc.driver.OracleDriver"
maxCount="4"
minCount="2"
password="admin"
url="jdbc racle:thin:@localhost:1521/AUTHORDB"
user="admin"
/>
</data-sources>



Thanks,
Prakash
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Any time there is a duplicate definition in the struts-config.xml file, the second definition is the one that will be used.

Note: Support for the Struts DataSource utility has been removed from the latest version of Struts (1.3.5). If you want your application to be upgradeable to the latest version, you may want to consider defining the DataSource as a JNDI resource in your application server instead of with the Struts utility.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic