This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

connecting to server DataSource using POJO.

 
Andrews Arokiam
Greenhorn
Posts: 6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using the default DataSource provided along with the glassfish server (Derby). When I try to connect to it using servlets it works without any problem. But what am trying to do is use a common POJO from which I can get a Connection. So when I try to use the DataSource in a POJO it doesn't work.

I know that Servlets can refer to DataSource through resource ref and glassfish-resources.xml

Am using netbeans. Is there a way so that I can use a POJO for using DataSource. This question has come up time and again. But I couldn't find any solution. Its not that I want to use server DataSource, I want it to be declarative rather than programmatic.

I know this question has come up before but that thread is dead.


 
Madhan Sundararajan Devaki
Ranch Hand
Posts: 312
Java MS IE
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Datasource within an application server can be used only by Enterprise components such as Servlet, JSP, EJB, etc...

POJO should attempt to use JDBC or any ORM frameworks to satisfy its needs.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic