• 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
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Retrieving datasource from init(ActionServlet, ModuleConfig)

 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all, how can i obtain a datasource from de init(ActionServlet, ModuleConfig) methos inside a class that implements Plugin
Here is the code:


Thanks in advance
 
Ranch Hand
Posts: 254
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It is generally considered bad design to use the Struts datasource feature since it introduces a dependency between your controller (struts) and your model. Instead use your JNDI, follow this link:

https://coderanch.com/t/51774/Struts/struts-database-connection
 
Jesus Fernandez
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the reply Kerry.
But my goal is obtain a DataSource when my application startup ro retrieve some data from a BD. That's why i need the DataSource. My question is how can i obtain this one from the init method of a class that implements Plugin and execute both the init(..) and destroy() methods
Thanks in advance
 
reply
    Bookmark Topic Watch Topic
  • New Topic