• Post Reply Bookmark Topic Watch Topic
  • New Topic

Data Access Object Design pattern . How to use it..  RSS feed

 
Nehal Dave
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
this is the prob...
Context ctx = new InitialContext();
javax.sql.DataSource ds = (javax.sql.DataSource) ctx.lookup ("nehalDS");

Connection con = ds.getConnection();
Statement stmt = con.createStatement();
stmt.execute(some query");
ResultSet rs = stmt.getResultSet();
the same code i am using in all the jsps through out the site to access the oracle database. I need to abstract it into some reuseable pattern.i found out Data Access Object pattern is the solution but how to use it... can any1 help me with some small example on which i can built up...
Thanks
Nehal.
[ December 02, 2002: Message edited by: Nehal Dave ]
 
Kyle Brown
author
Ranch Hand
Posts: 3892
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is code for the DAO pattern included in the Java Blueprints.
Kyle
 
Mathews P Srampikal
Ranch Hand
Posts: 211
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thank you kyle it is a good URL
 
Nehal Dave
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Kyle Brown
Thanks
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!