使用 try-with-resources 或在“finally”子句中关闭此“语句”。错误声呐

问题描述 投票:0回答:0

public ResultSet listarMesas() throws SQLException { String consulta="SELECT * FROM mesas order by id asc"; try { Statement sentencia = conexion.obtener().createStatement();结果集 resultado = sentencia.executeQuery(consulta);返回结果; } catch (ClassNotFoundException | SQLException e) { e.printStackTrace();返回空值; } }

java sonarqube sonarqube-scan
© www.soinside.com 2019 - 2024. All rights reserved.