OK. I based my comments on some code I was looking at where there were
multiple methods in a single class, and in each method, some result sets
were traversed, and in a finally block, the result set & statement were
closed. In that type of code, I think it may not be necessary to close
result sets, but as a best practice, lets always close them.

Azeez



On Mon, Sep 27, 2010 at 8:26 AM, Anjana Fernando <[email protected]> wrote:

> On Sat, Sep 25, 2010 at 1:22 PM, Afkham Azeez <[email protected]> wrote:
>
>> Please note that it is not necessary to close both the ResultSet and
>> Statement. When Statement#close is called, the ResultSets generated by those
>> Statements are also closed. Please refer to the JavaDocs
>> of java.sql.Statement
>
>
> Hi Azeez,
>
> But it is good practice to close the ResultSet immediately after it is
> used, rather than letting is automatically close when the Statement is
> closed right at the end. Because also, from one Statement, there can be many
> result sets and all those resources will be there till the end rather than
> being cleaned up then and there after it is used.
>
> Cheers,
> Anjana.
>
>
>>
>> Azeez
>>
>>
>>
>>
>> On Sat, Sep 25, 2010 at 1:07 PM, Afkham Azeez <[email protected]> wrote:
>>
>>> If you guys come across the following error related to JDBC, please don't
>>> ignore it. Let me know if you cannot figure out how to fix it.
>>>
>>>        Method may fail to clean up stream or resource
>>>
>>>
>>> On Tue, Sep 21, 2010 at 2:09 PM, Afkham Azeez <[email protected]> wrote:
>>>
>>>> Hi folks,
>>>> We are planning to have $subject this Thursday at the #59 office.
>>>> Volunteers please be in office at 9.30 AM.
>>>>
>>>> See:
>>>> https://spreadsheets.google.com/a/wso2.com/ccc?key=0AnW7aoJmJW4wdGlnRGR0OVNRSFRmTHo0dHlMbHJMM0E&hl=en#gid=2
>>>>
>>>> Thanks
>>>> --
>>>> *Afkham Azeez*
>>>> Senior Software Architect & Senior Manager; WSO2, Inc.; http://wso2.com
>>>> ,
>>>> *
>>>> *
>>>> *Member; Apache Software Foundation; 
>>>> **http://www.apache.org/*<http://www.apache.org/>
>>>> *
>>>> email: **[email protected]* <[email protected]>* cell: +94 77 3320919
>>>> blog: **http://blog.afkham.org* <http://blog.afkham.org>*
>>>> twitter: 
>>>> **http://twitter.com/afkham_azeez*<http://twitter.com/afkham_azeez>
>>>> *
>>>> linked-in: **http://lk.linkedin.com/in/afkhamazeez*
>>>> *
>>>> *
>>>> *Lean . Enterprise . Middleware*
>>>>
>>>>
>>>>
>>>
>>>
>>> --
>>> *Afkham Azeez*
>>> Senior Software Architect & Senior Manager; WSO2, Inc.; http://wso2.com
>>> ,
>>> *
>>> *
>>> *Member; Apache Software Foundation; 
>>> **http://www.apache.org/*<http://www.apache.org/>
>>> *
>>> email: **[email protected]* <[email protected]>* cell: +94 77 3320919
>>> blog: **http://blog.afkham.org* <http://blog.afkham.org>*
>>> twitter: **http://twitter.com/afkham_azeez*<http://twitter.com/afkham_azeez>
>>> *
>>> linked-in: **http://lk.linkedin.com/in/afkhamazeez*
>>> *
>>> *
>>> *Lean . Enterprise . Middleware*
>>>
>>>
>>
>>
>> --
>> *Afkham Azeez*
>> Senior Software Architect & Senior Manager; WSO2, Inc.; http://wso2.com,
>> *
>> *
>> *Member; Apache Software Foundation; 
>> **http://www.apache.org/*<http://www.apache.org/>
>> *
>> email: **[email protected]* <[email protected]>* cell: +94 77 3320919
>> blog: **http://blog.afkham.org* <http://blog.afkham.org>*
>> twitter: **http://twitter.com/afkham_azeez*<http://twitter.com/afkham_azeez>
>> *
>> linked-in: **http://lk.linkedin.com/in/afkhamazeez*
>> *
>> *
>> *Lean . Enterprise . Middleware*
>>
>>
>> _______________________________________________
>> Carbon-dev mailing list
>> [email protected]
>> https://mail.wso2.org/cgi-bin/mailman/listinfo/carbon-dev
>>
>>
>
>
> --
> Anjana Fernando
> Software Engineer
>
> WSO2, Inc.; http://wso2.com
> lean.enterprise.middleware
>
>
> _______________________________________________
> Carbon-dev mailing list
> [email protected]
> https://mail.wso2.org/cgi-bin/mailman/listinfo/carbon-dev
>
>


-- 
*Afkham Azeez*
Senior Software Architect & Senior Manager; WSO2, Inc.; http://wso2.com,
*
*
*Member; Apache Software Foundation;
**http://www.apache.org/*<http://www.apache.org/>
*
email: **[email protected]* <[email protected]>* cell: +94 77 3320919
blog: **http://blog.afkham.org* <http://blog.afkham.org>*
twitter: **http://twitter.com/afkham_azeez*<http://twitter.com/afkham_azeez>
*
linked-in: **http://lk.linkedin.com/in/afkhamazeez*
*
*
*Lean . Enterprise . Middleware*
_______________________________________________
Carbon-dev mailing list
[email protected]
https://mail.wso2.org/cgi-bin/mailman/listinfo/carbon-dev

Reply via email to