• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Liutauras Vilda
  • Paul Clapham
Sheriffs:
  • paul wheaton
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Piet Souris
Bartenders:
  • Mike London

Spring Persistance

 
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,
I am developing a Spring based web application.The application needs to access the database.Where do I specify the database
access parameters?Do I specify them in the xml file which I use for other purposes-for dependency injection,forwards to appropriate JSPs
etc?If I specify the connection parameters in that xml file,how do i read the values in the classes where I need them inorder to write
database related queries?I plan to use the JDBCTemplate class for the queries.

Please advise.

Thanks
Richard
 
Ranch Hand
Posts: 686
Netbeans IDE Chrome Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes same file. You can also externalize the connection details. Check the guide : http://static.springsource.org/spring/docs/2.5.6/reference/jdbc.html
 
Richard Ellison
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks.I will take a look.

Richard
 
reply
    Bookmark Topic Watch Topic
  • New Topic