Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: How to get feedback form JDBC insert statement (i.e.: "1 row inserted")
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