• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

data source Problem in Struts

 
s. anitha
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
please give sample code for connecting mysql and struts using datasource> tag

plz help me

thanks in advance
 
Klaus Jesper
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just an example, should work:

<data-sources>
<data-source type="org.apache.commons.dbcp.BasicDataSource">
<set-property property="driverClassName" value="com.mysql.jdbc.Driver" />
<set-property property="url" value="jdbc:mysql://localhost:3306/testDB" />
<set-property property="username" value="testuser"/>
<set-property property="password" value="testPW" />
</data-source>
</data-sources>

Maybe this would help, too:
http://struts.apache.org/faqs/database.html

Klaus
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic