File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Java in General and the fly likes JDBC Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "JDBC" Watch "JDBC" New topic


giridhar reddy

Joined: Nov 07, 2003
Posts: 5
If you are truncated using JDBC, How can you know ..that how much data is truncated ?
Sam Moran
Ranch Hand

Joined: Sep 28, 2002
Posts: 86
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!!

We make a living by what we get, we make a life by what we give!
Jamie Robertson
Ranch Hand

Joined: Jul 09, 2001
Posts: 1879

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 ).
I agree. Here's the link:
subject: JDBC
It's not a secret anymore!