[JAVA] Improper Resource Releases

 


It's because we didn't finally release the resources
It corresponds to a violation of the web vulnerability.


ex)

Connection conn = null;

PreparedStatement pstmt = null;

ResultSet rs = null;

try

{

// conn , pstmt , rs code

}catch(NullPointerException e){


finally{

if(rs!=null){rs.close();}

if(pstmt!=null){pstmt.close();}

if(conn!=null){conn.close();}

}


😀

Thank you !!

감사합니다 !!


Comments