SCJP 1.5
[OCP 17 book] | [OCP 11 book] | [OCA 8 book] [OCP 8 book] [Practice tests book] [Blog] [JavaRanch FAQ] [How To Ask Questions] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
Originally posted by Jeanne Boyarsky:
Timothy,
Driver odditiy? It should return 3, but some drivers are a bit flakey when it comes to return values.
Reid - SCJP2 (April 2002)
SCJP 1.5
SCJP 1.5
Originally posted by Reid M. Pinchback:
TRUNCATE is a bit different from delete; you get 0 because truncate is a DDL statement, not DML, so it isn't examining the data to do things like cascades, etc., it just drops the data segments from the tablespace (or equivalent storage mapping).
Originally posted by Timothy Sam:
Oooops sorry... I'm using MySQL database...
Reid - SCJP2 (April 2002)
SCJP 1.5
Originally posted by Andy Grove:
The problem is that you are trying to bind a parameter to a LIKE clause. You cannot do this in JDBC. It is not parameterizable in the way that most other query criteria are.
You need to manually construct your SQL statement to include the department id
e.g.
query = "DELETE FROM departments_tbl WHERE department_id LIKE '" + departmentId + "'"
Hope that helps.
Cheers,
Originally posted by Timothy Sam:
Hi, after changing my MySQL driver. I still experience the same problem... Maybe I should just quit from checking if a records has really been deleted?
Originally posted by Reid M. Pinchback:
Ouch! Point taken. Bad commute day, huh?
Consider Paul's rocket mass heater. |