Statement

2 respostas
rocha

pessoal ao invés de usar :

executeUpdate
st.executeQuery

posso usar somente:
execute

Rocha

2 Respostas

danieldestro

Tem que ler a documentação: http://java.sun.com/j2se/1.4.2/docs/api/java/sql/Statement.html

boolean execute(String sql)
Executes the given SQL statement, which may return multiple results.

executeQuery(String sql)
Executes the given SQL statement, which returns a single ResultSet object.

int executeUpdate(String sql)
Executes the given SQL statement, which may be an INSERT, UPDATE, or DELETE statement or an SQL statement that returns nothing, such as an SQL DDL statement.

jgbt

se vc olhar em http://java.sun.com/j2se/1.4.2/docs/api/
vai ver que eles tem retornos diferentes.
cada um deles tem uma finalidade.
da uma lida nas docs.

[]'s

Criado 11 de março de 2005
Ultima resposta 11 de mar. de 2005
Respostas 2
Participantes 3