executeQuery() is for command objects i.e., this
Moreover the executeQuery() is not used in
executeNonQuery() uses the "Insert/Update/Delete/Stored subprogram" , this
Interviews2 answers

Sanjeev Singh
Posted Feb 19, 2009, 7:36 PM ESTexecuteQuery() is for command objects i.e., this
Moreover the executeQuery() is not used in
executeNonQuery() uses the "Insert/Update/Delete/Stored subprogram" , this
We have ExecuteNonQuery and ExecuteReader(not ExecuteQuery)
ExecuteNonQuery: Executes Insert, Update, and Delete statements (DML statements) and returns the number of rows affected.
ExecuteReader: Executes the SQL query (Select statement) and returns a Reader object which can perform a forward only traversal across the set of records being fetched.
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend4days leftRegisterMembers onlyFeatured eBookClaude for AI-Native BuildersDownload nowAnswer an interview question and earn +10 SHARP for every answer.
See unanswered questions