Ola pessoal,
Alguém poderia me dizer se estes dois metodos estão corretos?
public ResultSet executeQueryMethod(String sql) {
try {
final Connection conn = EntityManager.getConnection();
PreparedStatement preparedStatement= conn.prepareStatement(sql);
ResultSet rs = preparedStatement.executeQuery();
return rs;
} catch (SQLException e) {
throw new RuntimeException(e);
}
}
public int executeUpdateMethod(String sql) {
try {
final Connection conn = EntityManager.getConnection();
PreparedStatement preparedStatement = conn.prepareStatement(sql);
return preparedStatement.executeUpdate();
} catch (SQLException e) {
throw new RuntimeException(e);
}