+ Reply to Thread
Results 1 to 5 of 5

Thread: JDBC Topic- Statements Question ?

  1. #1
    Member
    Join Date
    Feb 2006
    Location
    India
    Posts
    48
    Rep Power
    9
    Hello Friends, Please Help Me with the Answers to the Below Questions:


    While I was reading the JDBC Topic- Statements, I have come across these Questions.

    Callable Statement is used to call stored Procedure, but Prepared Statement is
    used to call Sql Query Statements.”

    Q.) What is the difference between Stored Procedures and Sql Query Statements?

    Q.) What are Run Time Parameters?




    Aparna.

  2. #2
    Moderator
    Join Date
    Feb 2006
    Posts
    1,411
    Rep Power
    24
    hello





    You use Prepared Statement when u want a SQL query to be called
    multiple times instead of writing many times u jus write a Prepared
    Statement and call that .



    Ex:



    PreparedStatement psmt= con.prepareStatement("Select ename from employees where eid=210");





    But Callable Statement: Once u establish a connection to the database
    if u want to excecute the SQL Stored procedures then use Callable
    Statement by using amethod prepareCall() This method will
    handle one or more parameters like IN , OUT, INOUT types....








    http://livetolead.blogspot.com/
    all the best
    Arise Awake N Stop Not Until Ur Goal Is Reached!

  3. #3
    Moderator
    Join Date
    Feb 2006
    Posts
    1,411
    Rep Power
    24
    hello




    Q.) What is the difference between Stored Procedures and Sql Query Statements?




    Well Stored Procedures is asubroutine which does certain actions ..




    A group of SQL statements will be executed .




    A procedure can also have arguments like IN , OUT , INOUT paramenters ..




    Depending on the arguments passed they will be executed


    IN Parameter -- passes a constant value from the calling environment into the procedure


    OUT parameter--passes a value from the procedure to the calling environment

    IN OUT - passes a value from the calling environment into the procedure
    and a possibily different value from the procedure back to the calling
    environment using the same parameter




    bye


    sowmya







    http://livetolead.blogspot.com/
    all the best
    Arise Awake N Stop Not Until Ur Goal Is Reached!

  4. #4
    Moderator
    Join Date
    Feb 2006
    Posts
    1,411
    Rep Power
    24
    hello



    Q.) What are Run Time Parameters?





    When u execute the Procedure u pass parameters they are called actual parameters or run time parameters



    execute Procd_name( 1, " Sowmya");



    the parameters are run time parameters ..while declaring the procedute u need to declare them as IN parameters



    bye

    sowmya




    http://livetolead.blogspot.com/
    all the best
    Arise Awake N Stop Not Until Ur Goal Is Reached!

  5. #5
    Member
    Join Date
    Feb 2006
    Location
    India
    Posts
    48
    Rep Power
    9


    Thanks Sowmya, Thank you very Much. fINALLY YOU have Understood my Intention and the answer which you have posted for the question is what I want.





    This is the simplest words one can post in his/her own words and can be understandable by every one.





    Thank you Sowmya, Thank you very Much.








    Best Regards.


    aparna.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Content Relevant URLs by vBSEO 3.5.1 PL1