While I can think of ways for AspectJ to help here, a more appropriate
solution might be to use Spring's JDBCTemplate class. It solves this problem
and much more. Note that you can use this class even if your architecture is
not based on Spring i.e. you can use Spring just like any other library.
-Ramnivas
On 8/22/07, fyu33 <[EMAIL PROTECTED]> wrote:
>
> Hello, In a JDBC DAO implementatin class, we usually see the following
> pattern: ... private DataSource ds; public aMethod(){ Connection cx = null;
> try{ cx = ds.getConnection(); ... }catch(Exception e){ ... }finally{
> if(cx!=null){ try{ cx.close(); }catch(){ } } ... } it is tiring to code
> the same thing in all DAO methods. I am looking for a sample code showing
> how to use AspectJ to handle this. Thanks! Franck
> ------------------------------
> View this message in context: AspectJ and Dao
> class<http://www.nabble.com/AspectJ-and-Dao-class-tf4311292.html#a12273585>
> Sent from the AspectJ - users mailing list
> archive<http://www.nabble.com/AspectJ---users-f2219.html>at
> Nabble.com.
>
> _______________________________________________
> aspectj-users mailing list
> [email protected]
> https://dev.eclipse.org/mailman/listinfo/aspectj-users
>
>
_______________________________________________
aspectj-users mailing list
[email protected]
https://dev.eclipse.org/mailman/listinfo/aspectj-users