jueves, 5 de mayo de 2022

SQL Error: The executeQuery method must return a result set

 https://stackoverflow.com/questions/18998700/sql-error-the-executequery-method-must-return-a-result-set

 

To return data from a SELECT Statement

String sql_select = "Select name from people";

Statement st_1 = connection.createStatement();
ResultSet rs_1 = st_1.executeQuery((sql_select));

To just run an UPDATE statement

String sql_update = "Update people set name = 'Natalie' 
Statement st_2 = connection.createStatement();
st_2.executeUpdate(sql_update);

 

No hay comentarios:

Publicar un comentario