Prepared Statement



Table in Oracle Database (Prepared Statement) :- Insert , Update , Dynamic_Insert & Select

Select( Ctrl+a) , Copy ( Ctrl+c ) and Run the code for practice


Interface PreparedStatement

  • If we use statement interface the perfomance of the appilication is affected , if there are many queries of same type
    • Like 500 insert Query
    • Like 600 Delete Query
  • When ever a query is executed there are two process that take place between JDBC manager at java end and Database manager at DB end . two processes are Query parsing and execution plan for every Query. This is the performance overhead if we use statement interface . but when we use prepared statement interface these processes take place only once but they should be of same nature .





Queries
    In Dynamic quries the data is input by Programmer , means data insert during
  • Insert
  • Delete
  • select
  • update
Query Format



Static Delete (Prepared)

Delete command Delete the values from the table according to user which is already Exist in oracle Database.

Query is:- delete from student where srno=" +a;

  • EX In Java:-





Dynamic Update (Prepared)

Update command is using for updating the values of the table dynamically which is already Exist in oracle Database.

Query is:- update emp set ename='Tom' where eid=101

  • EX In Java:-





Dynamic Insert (Prepared)

insert command is used to insert data in table by user through keyboard which is already Exist in oracle Database.

Query is:- Select *from student

  • EX In Java:-