aspose file tools*
The moose likes Struts and the fly likes Struts with MySql Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts with MySql" Watch "Struts with MySql" New topic
Author

Struts with MySql

Sathy thyagaraj
Greenhorn

Joined: Jan 22, 2007
Posts: 17
how can i connect my struts application with MySql by using mysql-connector-java-5.0.4

Thanks

Sathy
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
Although earlier versions of Struts have a utility for setting up a DataSource in the struts-config.xml file, I'd strongly advise you not to use it. It's deprecated in later versions, and it just plain doesn't work very well.

The best practice for using a database in any J2EE application is to set up a DataSource in the Application Server's Java Naming and Directory Interface (JNDI), and then use JNDI in your application to "look up" the DataSource and use it. The process for setting up a DataSource in JNDI is a little different for each application server. Consult the documentation for the App server you're using for instructions on how to do it.

If you're using Tomcat 5 or above, this link should help.


Merrill
Consultant, Sima Solutions
Sathy thyagaraj
Greenhorn

Joined: Jan 22, 2007
Posts: 17
Thank you Higginson

Sathy
Sathy thyagaraj
Greenhorn

Joined: Jan 22, 2007
Posts: 17
Thank you Higginson

Sathy
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Struts with MySql
 
Similar Threads
Advice of database type is needed
Using datasource in netbeans to get connection
getting last row
Error when I deploy my Strut application on Tomcat
WA #1.....word association