is there any difference b/w connection of a simple java prog. and a servlet.

Discussion in 'Java' started by Garg, Dec 16, 2006.

  1. Garg

    Garg Guest

    Hi All,

    Can anny one help me.

    I am trying to update the database by using a callable statement. But
    in case of servlet i am getting an error
    java.sql.SQLException: Not all parameters bound.

    But if i call the same procedure with same data and every thing. it is
    able to update the database.

    I am not able to understand the difference between a simple java
    program call and a servlet call.

    Thanks
    Tarun Garg
     
    Garg, Dec 16, 2006
    #1
    1. Advertising

  2. Garg

    Daniel Pitts Guest

    Garg wrote:
    > Hi All,
    >
    > Can anny one help me.
    >
    > I am trying to update the database by using a callable statement. But
    > in case of servlet i am getting an error
    > java.sql.SQLException: Not all parameters bound.
    >
    > But if i call the same procedure with same data and every thing. it is
    > able to update the database.
    >
    > I am not able to understand the difference between a simple java
    > program call and a servlet call.
    >
    > Thanks
    > Tarun Garg

    I'm guessing that you're not Actually calling stored proc the same way
    in both cases. Use a debugger, or logger, to verify that the exact
    same SQL and parameters are passed through.
     
    Daniel Pitts, Dec 16, 2006
    #2
    1. Advertising

  3. Garg

    Garg Guest

    No.

    I am coping and pasting the same code from the jave prog. to the
    servlet. so there is no mismatch.

    butmine understanding is java prog is run by a JVM and that handles all
    the thing. but in case of servlet application server (tomcat i m using)
    is handling all these things. So is there any difference between
    'execute' of JVM and application server.

    Or as i am using Cache as a database, that it self is not able to
    handle this.

    Tarun Garg
     
    Garg, Dec 17, 2006
    #3
  4. Re: is there any difference b/w connection of a simple java prog.and a servlet.

    Garg wrote:
    > I am coping and pasting the same code from the jave prog. to the
    > servlet. so there is no mismatch.
    >
    > butmine understanding is java prog is run by a JVM and that handles all
    > the thing. but in case of servlet application server (tomcat i m using)
    > is handling all these things. So is there any difference between
    > 'execute' of JVM and application server.


    A standalone app and a servlet can differ in how the
    connection is created. There should be no
    difference in the execution of SQL statements.

    Try and check:
    - that JDBC driver version is the same
    - that the parameters you set are actually the same

    Arne
     
    =?ISO-8859-1?Q?Arne_Vajh=F8j?=, Dec 24, 2006
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. circuit_breaker
    Replies:
    2
    Views:
    2,018
    Jack Jia
    Apr 4, 2004
  2. RHNewBie

    null and NULL: is there any difference?

    RHNewBie, Sep 24, 2003, in forum: C Programming
    Replies:
    17
    Views:
    552
    Dan Pop
    Sep 26, 2003
  3. -intl.com
    Replies:
    1
    Views:
    371
    Martin Gregorie
    Oct 22, 2006
  4. Phil Powell
    Replies:
    0
    Views:
    331
    Phil Powell
    Aug 29, 2007
  5. Carfield Yim
    Replies:
    2
    Views:
    380
    Carfield Yim
    Jul 2, 2009
Loading...

Share This Page