Imagem de fundo

Considere a seguinte tabela NOTAS e seu...

Considere a seguinte tabela NOTAS e seu conteúdo.


NOTAS

codMatricula

codDisciplina

nota

1

12

5,5

2

21

9,0

3

22

10,0

4

12

6,5


Statement stmt = null;

String query = "select n.codMatricula, n.nota" +

"from NOTAS n";

try{

stmt = con. c reate Statement();

ResuItSet rs = stmt.executeQuery(query);

float nota = (float)0.0;

while (rs.next()) {

nota += rs.getFloat("nota");

}

System.out.println(nota);

} catch (SQLExceptione) {

e.printStackTrace();

} finally {

if (stmt != nuil) {stmt.close();}

}


Utilizando JDBC, o que o trecho de código Java imprime no console?


A

31,0


B

10,0


C

9,0


D

6,5


E

5,5