Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: How to get feedback form JDBC insert statement (i.e.: "1 row inserted")

Re: How to get feedback form JDBC insert statement (i.e.: "1 row inserted")

From: Thomas Kellerer <OSCUQDVXTKFJ_at_spammotel.com>
Date: Thu, 12 Aug 2004 11:18:49 +0200
Message-ID: <2o0qvqF5naqrU1@uni-berlin.de>


On 12.08.2004 09:51 Per Magnus L?vold wrote:

> Hi,
> I am working on a Java application which inserts data into an Oracle
> database.
>
> I am looking for a way to retreive the feedback from an insert
> statement.
> After inserting a row, the resultset and result set meta data are
> empty. I wonder how to retrieve the "1 row inserted" or feedback after
> performing the INSERT.
> Or do I perhaps have to create this logic myself? I.e. when the insert
> statement is executed silently, the row is successfully inserted? (-->
> "1 row inserted")
>

Quote from the Javadocs for Statement.executeUpdate()

"Returns: either the row count for INSERT, UPDATE or DELETE statements, or 0 for SQL statements that return nothing"

<http://java.sun.com/j2se/1.4.2/docs/api/java/sql/Statement.html#executeUpdate(java.lang.String)>

Thomas Received on Thu Aug 12 2004 - 04:18:49 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US