Statements in JDBC

Statements in JDBC:

Statement interface:

The Statement interface offers systems to execute request with the database. The declaration interface is a creation lines of ResultSet ,it gives preparing plant procedure to get the subject of ResultSet.


Statement Methods

Prepared Statement:

The PreparedStatement interface is a sub interface of Statement. It is utilized to execute parameterized inquiry.

We should see the case of parameteriSed inquiry:

String sql=”insert into emp values(?,?,?)”;

As should be obvious, we are passing parameter (?) for the qualities. Its esteem will be set by calling the setter techniques for PreparedStatement. The execution of the application will be speedier on the off chance that you utilize PreparedStatement interface since question is accumulated just once.

JAVA Tutorial Video

 Instance of PreparedStatement:

public PreparedStatement prepareStatement(String query)throws SQLException{}

Methods of prepared Statement:

Prepare Statement

Callable Statement:

CallableStatement interface is utilized to call the put away techniques and capacities. We can have business rationale on the database by the utilization of put away methodology and capacities that will improve the execution in light of the fact that these are recompiled.

Assume you require the get the age of the representative in view of the date of birth ,you may make a capacity that gets date as the info and returns age of the worker as the yield.

Instance of CallableStatement:

public CallableStatement prepareCall(“{ call procedurename(?,?…?)}”);

example the instance of CallableStatement :

CallableStatement stmt=con.prepareCall(“{call myprocedure(?,?)}”);

Data access :

Callable Statement

 The protest of ResultSet keeps up a cursor indicating a line of a table. At first, cursor focuses to before the principal push.Be that as it may, we can make this question push ahead and reverse way by passing either TYPE_SCROLL_INSENSITIVE or TYPE_SCROLL_SENSITIVE in create Statement(int,int) technique and in addition we can make this protest as update.

to our newsletter

Drop Us A Query

Trending Courses
  • Pega testing training
    PEGA Testing Training
  • Today application testing is the deciding factor to launch the application into the market. And people do not launch the application unless it goes true.

  • blockchain course
    Blockchain Online Course
  • Today many people were enthusiastic, to know the exact details of things happening around him. This can get the proper knowledge on Blockchain.

  • ethical hacking course
    Ethical Hacking Certification Course
  • Zeal to learn ethical hacking is common among college students and IT professionals. Because everybody wants to secure their system from cyber attacks.

  • python training
    Python Online Training
  • Python is a dynamic interrupted language which is used in wide varieties of applications. It is very interactive object oriented and high-level programming language.

  • Tableau Training
    Tableau Training
  • Tableau is a Software company that caters interactive data visualization products that provide Business Intelligence services. The company’s Head Quarters is in Seattle, USA.

  • what is pega
    PEGA Online Training
  • Pega Systems Inc. is a Cambridge, Massachusetts based Software Company. It is known for developing software for Customer Relationship Management (CRM) and Business process Management (BPM).

100% Secure Payments. All major credit & debit cards accepted.