Return-Path: Delivered-To: apmail-ibatis-user-java-archive@www.apache.org Received: (qmail 63213 invoked from network); 8 Dec 2005 23:28:51 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 8 Dec 2005 23:28:51 -0000 Received: (qmail 89123 invoked by uid 500); 8 Dec 2005 23:28:51 -0000 Delivered-To: apmail-ibatis-user-java-archive@ibatis.apache.org Received: (qmail 88812 invoked by uid 500); 8 Dec 2005 23:28:49 -0000 Mailing-List: contact user-java-help@ibatis.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user-java@ibatis.apache.org Delivered-To: mailing list user-java@ibatis.apache.org Received: (qmail 88796 invoked by uid 99); 8 Dec 2005 23:28:49 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 08 Dec 2005 15:28:49 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [69.93.60.82] (HELO Roger.s2g-limited.com) (69.93.60.82) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 08 Dec 2005 15:28:48 -0800 X-Spam-Level: Received: from spaz ([70.30.224.101]) (authenticated user michael@s2g-limited.com) by Roger.s2g-limited.com (Kerio MailServer 6.0.3) (using TLSv1/SSLv3 with cipher RC4-MD5 (128 bits)) for user-java@ibatis.apache.org; Thu, 8 Dec 2005 18:28:25 -0500 From: "Michael Laccetti [c]" To: Subject: RE: Multiple deletes? [signed] Date: Thu, 8 Dec 2005 18:28:25 -0500 Message-ID: <000001c5fc4f$1713b2b0$0201000a@spaz> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 11 Thread-Index: AcX8HI3n/P+3DRggTuON2WUCuQbojwAB+NEgAAiO4UAAAhg0IA== In-Reply-To: <50CA25BD6EEA954FA592C097399942E309313A5C@CM1.wis.local> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670 X-Virus-Checked: Checked by ClamAV on apache.org X-Old-Spam-Status: No, hits=0.0 required=8.5 tests=BAYES_00: -4.901,SARE_RECV_ADDR: 0.027 X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Yeah, I just saw Eric's suggestion. That looks pretty good, I'm going to switch it to that tomorrow. Mike -----Original Message----- From: Niels Beekman [mailto:n.beekman@wis.nl] Sent: December 8, 2005 5:30 PM To: user-java@ibatis.apache.org Subject: RE: Multiple deletes? Larry means iterating your list, that would still result in one query, but one that works and still protects against SQL injection. Niels -----Original Message----- From: Michael Laccetti [c] [mailto:michael@s2g-limited.com] Sent: donderdag 8 december 2005 23:12 To: user-java@ibatis.apache.org Subject: RE: Multiple deletes? [signed] If I used iteration, I'd have a lot of queries. Since this database can scale to be pretty huge, I'd prefer to not do that. Also, the information isn't blindly pulled from a form, and then jammed into the database. Validation does happen. And it worked. Thanks kindly. :) -----Original Message----- From: larry.meadors@gmail.com [mailto:larry.meadors@gmail.com] On Behalf Of Larry Meadors Sent: December 8, 2005 12:26 PM To: user-java@ibatis.apache.org Subject: Re: Multiple deletes? You could do this: DELETE FROM ALERTS WHERE ID IN ($value$) It is beggin for SQL injection, but...it will work. A better route would be to use iteration to do it. Larry On 12/8/05, Michael Laccetti [c] wrote: > I have the following statement defined in iBATIS: > > > DELETE FROM ALERTS WHERE ID IN (#value#) > > I pass it a String in the form of 322,321,320,319,318,317,316,315,314,313. > > Now, when I call it, I get the following: > DEBUG [08 Dec 05 11:19:26] [http-8080-Processor23] > java.sql.PreparedStatement - {pstm-100004} PreparedStatement: DELETE > FROM ALERTS WHERE ID IN (?) > DEBUG [08 Dec 05 11:19:26] [http-8080-Processor23] > java.sql.PreparedStatement - {pstm-100004} Parameters: > [322,321,320,319,318,317,316,315,314,313] > DEBUG [08 Dec 05 11:19:26] [http-8080-Processor23] > java.sql.PreparedStatement - {pstm-100004} Types: [java.lang.String] > ERROR [08 Dec 05 11:19:26] [http-8080-Processor23] > com.cibcwm.go.otis.gowmon.web.struts.action.IndexAction - Could not > remove > alert(s) from database. > com.ibatis.common.jdbc.exception.NestedSQLException: > --- The error occurred in conf/gowmon.xml. > --- The error occurred while applying a parameter map. > --- Check the deleteAlerts-InlineParameterMap. > --- Check the statement (update failed). > --- Cause: org.apache.derby.client.am.SqlException: Invalid character > string format for type INTEGER. > > I know that the statement itself is valid; I can run it directly no problem. > The question is, how do I get this to work with iBATIS. > > Mike > > > > -- ------------------------ [ SECURITY NOTICE ] ------------------------ To: user-java@ibatis.apache.org. For your security, michael@s2g-limited.com digitally signed this message on 08 December 2005 at 23:28:26 UTC. Verify this digital signature at http://www.ciphire.com/verify. ------------------- [ CIPHIRE DIGITAL SIGNATURE ] ------------------- Q2lwaGlyZSBTaWcuAjh1c2VyLWphdmFAaWJhdGlzLmFwYWNoZS5vcmcAbWljaGFlbEBzM mctbGltaXRlZC5jb20AZW1haWwgYm9keQAmCQAAfAB8AAAAAQAAAJrBmEMmCQAA4gIAAg ACAAIAIIXYnAvwVJnXYkeNqqLiR5ZyHRK7W0tiTAYcV7p1uX8mAQAxTkdmLdtsIbMe4FE 6BpyDx/u9eVN0WyoQPcWCmWDyD3Tk9a6CzZGZZZHs9QMS46dnovwOKE/ECrHXb0+o/yGh iPQGU2lnRW5k --------------------- [ END DIGITAL SIGNATURE ] ---------------------