Hi Chua!
It is perfectly legal to use executeUpdate() method to check how many rows
have been affected by the query. You typically use execute() method to return
a ResultSet and execute() to return boolean value.
I hope this clarifies your doubt.
MKumaresan
Jerson Chua <[EMAIL PROTECTED]> wrote:
> Hello EJB Gurus...
> Sorry for asking this off topic question here.
> I have a very simple question. I'm trying to insert a row to a table using
> JDBC.
> Is it logical or does it make sense to check if the executeUpdate returns
> the value 1? To make sure that the row is indeed inserted to the table.
>
> e.g.
> Does this make sense?
> if (pStmt.executeUpdate() != 1) {
> //throw Exception
> }
> or
> pStmt.executeUpdate() is enough.
>
> What's your opinion?
>
> Jerson Chua, SCJP2
> Java Applications Engineer
> CyberJ Resources, Inc.
> 1408/1409 Jollibee Plaza, Emerald Avenue
> Ortigas Centre, Pasig City
> Philippines
> T: 632.638.61.38
> F: 632.638.61.39
> Email: [EMAIL PROTECTED]
>
> ===========================================================================
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> of the message "signoff EJB-INTEREST". For general help, send email to
> [EMAIL PROTECTED] and include in the body of the message "help".
____________________________________________________________________
Get free email and a permanent address at http://www.netaddress.com/?N=1
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".