R4R Team working to provide free of cost for experienced and freshers

Tutorials | Examples|Interview Questions and Answers|Java Tutorials| C Tutorials | C++ Tutorials | Spring Tutorials| Hibernate Tutorials | JSP Tutorials | Servelets Tutorials| C# Tutorials | PHP Tutorials etc , Basics | Download Software | Data Types | Variables | Constant | Storage & Classes | Operators | Decisions Making | Loops | Functions| Numbers | Arrays | Pointers | String | Datastructure | Expressions | Preprocessor Statement | I/O | Exception Handling | OOPs Tutorial | Classes and object |C++ Inheritance Overloading | Polymorphism | Abstraction | Encapsulation | Interfaces | Multithreading etc


JDBC Projects

JDBC Project 1

Statement of the JDBC
Previous Home Next

There are three types of statement is available in the JDBC, which are listed bellow-

  1. Statement
  2. PreparedStatement
  3. CallableStatement

JDBC Statement is an interface of java.sql.*; package, which is used for execution of SQL statement. Statement returns an object, which is contain the result. Statement interface provides basic method for SELECT, UPDATE, INSERT, DELETE query in the database. The query which is stored in object compiled every time when request is made. the statement is little slower than preparedStatement.


The preparedStatement is access the functionality of java.sql.Statement and add some extra feature in it.This version of the statement allows to precompile the query. In the preparedStatement, the query do not compile every time when the request is made. Creating a PreparedStatement:-

PreparedStatement psmt=con.prepareStatement(" SELECT * from student");

This psmt object contains the record of the Students table, which is sent to the DBMS for execution.Now you are pass the parameter to psmt object as


This sets the String "Sam" to the third column of the Student table.

JDBC CallableStatement

JDBC Callable statement is a way of calling the store procedures of the database. It procedure stored in the database.It calls are written in escape syntax which may take one or two forms.The CallableStatement object is created by calling a prepareCall() method of connection,Syntax is given below:-

CallableStatement cstmt = connection.prepareCall("CALL HI()");
Previous Home Next