?
Solved

What is the difference B/w these two statements????????????????

Posted on 2006-03-26
4
Medium Priority
?
175 Views
Last Modified: 2010-04-01
Hi...
In my program...i am closing the CallableStatement object like....this

Ist Method:

CallableStatement stmt = session.getCallableStatement("deleteUsers");

session.closeCallableStatement("deleteUsers");

IIMethod:

stmt .close();

Let me know what is the difference between these two methods...........Or if these are the same..........?????????
Suppose i didn't close the statement and resultset objects it is reducing the performance of the application or not...it is not a matter regarding the performance.

Thanks,
Venkat.





0
Comment
Question by:ramareddyj
2 Comments
 
LVL 11

Accepted Solution

by:
fargo earned 500 total points
ID: 16298241
Hi,

Ist Method:
CallableStatement stmt = session.getCallableStatement("deleteUsers");
session.closeCallableStatement("deleteUsers");

-->> This seems to be something customised in your application. There is nothing like getting the callable statement as you said.

IIMethod:
stmt .close();

This is the normal way of closing the stmt. If you close the statement the resultset bundled with the stmt will automatically gets closed.
Only thing to care about is closing of rs, stmt and connection should be done in finally block of try-catch-finally.

regards
fargo
0
 
LVL 16

Assisted Solution

by:suprapto45
suprapto45 earned 500 total points
ID: 16298437
Hi,

As what fargo said.

It seems that the first one is using Design pattern of http://www.trsilvius-co.com/j2ee/daopattern.htm
The second method is the normal way we close the statement. I am not sure about the first one but I always used the second method.

By looking at its implementation, they both are the same.

Thanks
David
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Strategic internal linking is often considered an SEO power technique, especially for content marketing. Do you need to hire an SEO agency to optimize you internal linking? No, this article will help you understand the basics of internal linking and…
LinkedIn blogging is great for networking, building up an audience, and expanding your influence as well. However, if you want to achieve these results, you need to work really hard to make your post worth liking and sharing. Here are 4 tips that ca…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Screencast - Getting to Know the Pipeline
Suggested Courses
Course of the Month14 days, 7 hours left to enroll

807 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question