Open anand-iisl opened 4 years ago
Connection conn = null; PreparedStatement ps = null; ResultSet rs = null; String retVal = ""; try { DbBean db = new DbBean(); conn = db.getconnection(); String query = "SELECT VALUE FROM SETTINGS WHERE ATTRIBUTE=?"; ps = conn.prepareStatement(query); ps.setString(1,"PORT"); rs=ps.executeQuery(); if(rs.next()) { String value = rs.getString(1).trim(); if(value.equals("") || rs.getString(1)== null) { System.out.println("Failed To get Value for Attribute :"+Attribute); } else retVal= value; } } catch (Exception e) { e.printStackTrace(); } finally {try {if(rs!=null) {rs.close();rs=null;}if(ps!=null) {ps.close();ps=null;}if(conn!=null) {conn.close();conn=null;}} catch (Exception e2) {e2.printStackTrace();}} return retVal;
===========
False positive
===========