Return-Path: Delivered-To: apmail-jakarta-commons-user-archive@www.apache.org Received: (qmail 80246 invoked from network); 13 May 2005 15:45:38 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 13 May 2005 15:45:38 -0000 Received: (qmail 18644 invoked by uid 500); 13 May 2005 15:49:48 -0000 Delivered-To: apmail-jakarta-commons-user-archive@jakarta.apache.org Received: (qmail 18580 invoked by uid 500); 13 May 2005 15:49:47 -0000 Mailing-List: contact commons-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Jakarta Commons Users List" Reply-To: "Jakarta Commons Users List" Delivered-To: mailing list commons-user@jakarta.apache.org Received: (qmail 18565 invoked by uid 99); 13 May 2005 15:49:47 -0000 X-ASF-Spam-Status: No, hits=0.5 required=10.0 tests=FROM_ENDS_IN_NUMS X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: local policy) Received: from web50402.mail.yahoo.com (HELO web50402.mail.yahoo.com) (206.190.38.67) by apache.org (qpsmtpd/0.28) with SMTP; Fri, 13 May 2005 08:49:47 -0700 Received: (qmail 93499 invoked by uid 60001); 13 May 2005 15:45:23 -0000 Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; b=ShBlkPDXzKB430E0D+0Z0A/KPWusSZWRJAH8agJhdIXL6tA9FiyAKTtNgKdLXD2YVXgsubVbxSKPUO3Kl/hlzDdcpqGZa4jvxb+RGxuvZRnRAfmJXL33MKvDe8f+wFyKqYCCG1hJx3vQtTPfsSjV+JZM8C6ev16zAT3z5WCm63A= ; Message-ID: <20050513154523.93495.qmail@web50402.mail.yahoo.com> Received: from [66.80.49.7] by web50402.mail.yahoo.com via HTTP; Fri, 13 May 2005 08:45:23 PDT Date: Fri, 13 May 2005 08:45:23 -0700 (PDT) From: David Graham Subject: Re: [dbUtils] - QueryRunner question To: Jakarta Commons Users List In-Reply-To: 6667 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Checked: Checked X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Make sure you are using a java.sql.Date and not a java.util.Date. Some JDBC drivers accept java.util.Date but others only accept java.sql.Date or java.sql.Timestamp. If I remember correctly, the JDBC spec only requires drivers to accept java.sql.Date in PreparedStatement.setObject(). David --- Jonathan E Bricker wrote: > I'm getting an SQLException with > QueryRunner.update(Connection,String,Object[]) method and I wanted to > see > if I was doing this correctly. > > My values for the insert come from a ValueObject. All of the fields are > > Strings EXCEPT informed_consent_date which is a date and Patient_Id > which > is a BigDecimal. Patient_ID is null because there is a trigger that > will > fill that field. > > I take my fields in the VO and put them in an ArrayList then use > toArray(Object[]) to get them into the array. > > When I use the method I get an InvalidColumn. I suspect that this is > the > Date fields not matching or getting translated correctly. Any ideas > would > be helpful. > > SQLException = Invalid column type Query: insert into ATD_PATIENT > (PATIENT_ID,GENDER_CODE,BIRTH_YEAR,INFORMED_CONSENT_DATE,ENCRYPTED_EXTERNAL_ID,RACIAL_GROUP,SPECIES,COLLABORATION,USER_1_USER_ID) > > VALUES(?,?,?,?,?,?,?,?,?) Parameters: [null, M, 1965, 2005-05-05, > auDcPckKiXAkFpzwGHqFYaqPdgI, White, Human, IU, 11] > > > Jonathan Bricker > Lilly Research Labs > > Get Firefox! http://www.mozilla.org/firefox/ __________________________________ Yahoo! Mail Mobile Take Yahoo! Mail with you! Check email on your mobile phone. http://mobile.yahoo.com/learn/mail --------------------------------------------------------------------- To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-user-help@jakarta.apache.org