File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Spring and the fly likes Databaseconnection Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Application Frameworks » Spring
Reply Bookmark "Databaseconnection" Watch "Databaseconnection" New topic
Author

Databaseconnection

mike molin
Greenhorn

Joined: Nov 11, 2010
Posts: 14
Hi !

How do you establish a database connection using spring mvc ?
where and how does the configuration look like ?
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 16624

mike molin wrote:Hi !

How do you establish a database connection using spring mvc ?
where and how does the configuration look like ?


In a Spring Application you usually define a datasource through xml Spring configuration like



Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 16624

Now the package for that class might be wrong, or you might be using an implementation of a Datasource provided by a database vendor and you might have other properties to set, but that is now a bean you can inject into any class that needs it.

Mark
 
 
subject: Databaseconnection
 
Threads others viewed
thanks!!! another SCJP born~
Args in Netbeans
Ant and Cactus - classpath issues
http-method not specified
Clock problem
IntelliJ Java IDE