Hi,

Yes, for example if you use a stored procedure and an
error is trapped in there. THen from the calling java
program, it will appear that all went well at the
server side where the stored procedure was executed.

ron


--- Jerson Chua <[EMAIL PROTECTED]> wrote:
> Thanks for your reply...
> But my question is do I still need to check if the
> executeUpdate returns the
> value 1 cause I think if the executeUpdate fails, it
> would throw an
> exception. I just want to know if there's a
> possibility that the row is not
> inserted and no exception is thrown.
>
> Jerson
>
> -----Original Message-----
> From: A mailing list for Enterprise JavaBeans
> development
> [mailto:[EMAIL PROTECTED]]On Behalf Of
> Kumaresan Manickavasagam
> Sent: Tuesday, November 07, 2000 3:01 AM
> To: [EMAIL PROTECTED]
> Subject: Re: [JDBC Question]
>
>
> 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".
>  . to [EMAIL PROTECTED] and include in the body
> of the message "help".
> .
>
>
===========================================================================
> 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".
>


__________________________________________________
Do You Yahoo!?
Thousands of Stores.  Millions of Products.  All in one Place.
http://shopping.yahoo.com/

===========================================================================
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".

Reply via email to