No campo txtCedCusto2020 aparece o resultado da soma da coluna, porém, aparece entre colchetes duplos.
Como retiro os colchetes?
private void total2020(){
String sql = “select sum(valor) from tb_bruto where matricula like ? and ano = 2021”;
try {
pst = conexao.prepareStatement(sql);
pst.setString(1,txtCedMatricula.getText()+ “%”);
rs = pst.executeQuery();
txtCedCusto2020.setText(DbUtils.resultSetToNestedList(rs).toString());
} catch (Exception e) {
JOptionPane.showMessageDialog(null,e);
}
}