• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JDBC

 
giridhar reddy
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you are truncated using JDBC, How can you know ..that how much data is truncated ?
 
Sam Moran
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Depending on which DB you are using, I know that in Oracle when you issue the truncate command you remove all of the table entries. I suppose that you could get a count before issuing the truncate command and then you would know how many have been removed. I hope this helps!!
 
Jamie Robertson
Ranch Hand
Posts: 1879
MySQL Database Suse
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
giridhar,
you can issue a delete statement instead.
"DELETE FROM table WHERE 1 = 0". This statement will clear your table ( although probably not as efficiently as a truncate ) and the executeUpdate() method will return the number of rows effected ( deleted ).
Jamie
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic