Wednesday, June 17, 2015

AutoCloseable: the Star behind the scene

Every Java project has different culture as depending on  business requirements, developer or version of Java etc.

ORM libraries make developers' life more easy and resource control is undertaken by external ORM libraries.

I'm not JDBC expert but with Java SE 7 very good  functionality was introduced to Java developers.

Instead closing your prepared statement at the end of code line, by calling closeOnCompletion  method, it will be automatically closed.

I'd like to specify this old but gold feature because some of my friends don't aware of  the autoclosable interface  etc.

http://docs.oracle.com/javase/7/docs/api/java/sql/Statement.html
http://docs.oracle.com/javase/7/docs/api/java/sql/Connection.html


This is not only for JAVA.SQL also please visit Socket family :).