• Post Reply Bookmark Topic Watch Topic
  • New Topic

Retrieve return message

 
Jane Somerfield
Ranch Hand
Posts: 193
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm doing following simple SQL using JDBC. I need to retrieve the
return message "2 rows deleted". Could anyone tell me which
JDBC API I can use? Thanks.

SQL> delete from family_member where first_name='ann';

2 rows deleted.
 
Jeanne Boyarsky
author & internet detective
Sheriff
Posts: 35977
422
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jane,
If you call it using executeUpdate(), the method returns an integer (in your case 2.) Your code knows that it is performing a delete and can form an appropriate message.
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!