tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Adam Hardy <ahardy.str...@cyberspaceroad.com>
Subject Re: Yet another OT question.
Date Tue, 03 Feb 2004 08:31:41 GMT
Try writing a really obviously wrong SQL statement, just rubbish, & see 
if you force an error. Also check your DB logs to see whether it spat 
out an error log msg.

On 02/03/2004 07:51 AM Antonio Fiol BonnĂ­n wrote:
> 
> When we insert duplicates, we do get SQLException as a response. We are 
> using Oracle 9.2, however.
> 
> No idea why they behave differently. What does the DB do if you insert 
> duplicates from "sqlplus" or a similar tool?
> 
> Antonio Fiol
> 
> 
> George Sexton wrote:
> 
>> The error is signaled by getting 0 back as the number of affected
>> records.
>>
>> -----Original Message-----
>> From: David Short [mailto:dshort@san.rr.com] Sent: Monday, February 
>> 02, 2004 10:16 PM
>> To: 'Tomcat Users List'
>> Subject: RE: Yet another OT question.
>>
>>
>> My statement is performing an insert, which would not return a result
>> set.
>> An executeQuery() would return a result set.  I too, read the
>> description
>> about returning an int.  I intentionally tried inserting a duplicate
>> value
>> in the index, trying to force an error, and no error was generated.  The
>> return value was 0.  So, it is returning zero (nothing was inserted) but
>> that's it.  No SQLException.  There's got to be a way to catch an error
>> like
>> this.
>>
>> -----Original Message-----
>> From: George Sexton [mailto:gsexton@mhsoftware.com]
>> Sent: Monday, February 02, 2004 8:10 PM
>> To: 'Tomcat Users List'; dshort@san.rr.com
>> Subject: RE: Yet another OT question.
>>
>>
>> I broke out my JDBC handbook (JDBC API Tutorial and Reference, Second
>> Edition) and it says:
>>
>> "Returns an int indicating the number of rows affeted by an
>> INSERT,UPDATE, or DELETE statement; 0 if no rows were affected or the
>> statement executed was a DDL statement."
>>
>> "Throws SQLException if the sepcified argument is a statement that
>> generates a result set."
>>
>>> From reading this, it appears the driver is compliant and working per
>>
>> the specification.
>>
>> -----Original Message-----
>> From: David Short [mailto:dshort@san.rr.com]
>> Sent: Monday, February 02, 2004 7:59 PM
>> To: 'Tomcat Users List'
>> Subject: RE: Yet another OT question.
>>
>>
>> I pulled the latest (1.2 for Oracle 8.1.7) off of Oracle's web site
>> today.
>>
>> -----Original Message-----
>> From: George Sexton [mailto:gsexton@mhsoftware.com]
>> Sent: Monday, February 02, 2004 6:33 PM
>> To: 'Tomcat Users List'; dshort@san.rr.com
>> Subject: RE: Yet another OT question.
>>
>>
>> Probably a flake in the Oracle driver. Check you are using the latest
>> one.
>>
>> -----Original Message-----
>> From: David Short [mailto:dshort@san.rr.com]
>> Sent: Monday, February 02, 2004 4:18 PM
>> To: 'Tomcat Users List'
>> Subject: Yet another OT question.
>>
>>
>> It seems like a slow day on the list so, thought I'd throw my issue out
>> there.
>>
>> I'm working with Tomcat 4.1.0, Oracle 8.1.7 and JDBC 1.2.  It seems that
>> the
>> JDBC executeUpdate() method doesn't raise an exception when I pass an
>> incorrect SQL statement.  It returns 0 rows, but no exception.  Anyone
>> seen
>> this before?
>>
>>  
>>
> 


-- 
struts 1.1 + tomcat 5.0.16 + java 1.4.2
Linux 2.4.20 Debian


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message