• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Looking for utility

 
Chetan Parekh
Ranch Hand
Posts: 3640
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello All!

To select data from database we have to follow 4 steps each times:

Now since we are using WebLogic, it has its own Connection management system, so I can skip step 1) and 2).

Now for step 3) and 4) I am looking for a utility where I just have to pass a connection to the method and method will create Statement object and will execute the appropriate query.

i.e.

So whenever I have to select anything from the database, I have to do just

Similar for update/insert/delete.

Are there any utilities that this?

Reg,
Chetan
[ April 26, 2005: Message edited by: Chetan Parekh ]
 
Ganesh Gowtham
Ranch Hand
Posts: 225
IBM DB2 Eclipse IDE Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Chetan Parekh:
Hello All!

To select data from database we have to follow 4 steps each times:

Now since we are using WebLogic, it has its own Connection management system, so I can skip step 1) and 2).

Now for step 3) and 4) I am looking for a utility where I just have to pass a connection to the method and method will create Statement object and will execute the appropriate query.

i.e.

So whenever I have to select anything from the database, I have to do just

Similar for update/insert/delete.

Are there any utilities that this?

Reg,
Chetan

[ April 26, 2005: Message edited by: Chetan Parekh ]



Hi u want to use Utility class for all ur dbase connections just use DAO (Data Access object Design pattern) just grab some details abtr this dao ...
so can code ...easlily...

Thx and Regards
G R Ganesh Gowtham
grgowtham_cse@yahoo.com
 
Ganesh Gowtham
Ranch Hand
Posts: 225
IBM DB2 Eclipse IDE Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If u r still amazed how exactly dao works...

it is nothing but class which has so many static mtd's which purely depends of ur Req and b'logic....
Thx and Regards
G R Ganesh Gowtham
grgowtham_cse@yahoo.com
 
James Carman
Ranch Hand
Posts: 580
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Gowtham Ganamukala, please don't use so many abbreviations in your posts. It makes them difficult to read. As for the question, it seems as if you have a firm grasp on what needs to be written and it's quite trivial to write something like that. So, just go ahead and write it. But, if you want a more "beefed up" solution, I'd go with Spring (www.springframework.org). They've got frameworks which provide "template" classes for this sort of thing.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic