SlideShare a Scribd company logo
www.webstackacademy.com
JDBC
www.webstackacademy.com
What is JDBC?
Definition
● JDBC is a Java-based data access technology (Java Standard
Edition platform) from Oracle Corporation.
● This technology is an API for the Java programming language
that defines how a client may access a database.
● It provides methods for querying and updating data in a
database.
www.webstackacademy.com
JDBC History
● Before JDBC, ODBC API was used to connect and execute query to
the database.
● But ODBC API uses ODBC driver that is written in C language which
is platform dependent and unsecured.
● That is why Sun Micro System has defined its own API (JDBC API)
that uses JDBC driver written in Java language.
www.webstackacademy.com
JDBC History
● Sun Microsystems released JDBC as part of JDK 1.1 on February 19,
1997.
● The JDBC classes are contained in the Java package java.sql and
javax.sql
● The latest version, JDBC 4.2, and is included in Java SE 8.
www.webstackacademy.com
API
● The Java API is the set of classes included with the Java
Development Environment. These classes are written using the Java
language and run on the JVM. The Java API includes everything from
collection classes to GUI classes.
● JDBC is also an API.
www.webstackacademy.com
JDBC Drivers
● JDBC Driver is a software component that enables java application to
interact with the database.There are 4 types of JDBC drivers:
– Type 1: JDBC-ODBC bridge driver
– Type 2: Native-API driver (partially java driver)
– Type 3: Network Protocol driver (fully java driver)
– Type 4: Thin driver (fully java driver)
www.webstackacademy.com
Type 1:
JDBC-ODBC Bridge Driver
● The JDBC-ODBC bridge driver uses ODBC driver to connect to the
database. This is now discouraged because of thin driver.
www.webstackacademy.com
Type 2:
Native-API Driver
● The Native API driver uses the client-side libraries of the database.
● It is not written entirely in Java.
www.webstackacademy.com
Type 3:
Network Protocol Driver
● The Network Protocol driver uses middle ware (application server).
● It is fully written in Java.
www.webstackacademy.com
Type 4: Thin Driver
● The thin driver converts JDBC calls directly into the vendor-specific
database protocol.
● That is why it is known as thin driver.
● It is fully written in Java language.
● Better performance than all other drivers.
● No software is required at client side or server side.
● Disadvantage: Drivers depends on the Database.
www.webstackacademy.com
Steps to Connect to
Database
There are 5 steps to connect any java application with the database
in java using JDBC. They are as follows:
● Register the driver class
● Creating connection
● Creating statement
● Executing queries
● Closing connection
www.webstackacademy.com
Registering the
Driver
● The forName() method of Class class is used to register the driver
class.
●
Class.forName("com.mysql.jdbc.Driver");
www.webstackacademy.com
Creating
Connection Object
● The getConnection() method of DriverManager class is used to
establish connection with the database.
● Connection
con=DriverManager.getConnection( "jdbc:mysql://localhost:3306","roo
t","password");
www.webstackacademy.com
Creating Statement
Object
● The createStatement() method of Connection interface is used to
create statement. The object of statement is responsible to execute
queries with the database.
● Statement stmt=con.createStatement();
www.webstackacademy.com
Execute Query
● The executeQuery() method of Statement interface is used to execute
queries to the database. This method returns the object of ResultSet
that can be used to get all the records of a table.
● ResultSet rs=stmt.executeQuery("select * from emp");
while(rs.next()){
System.out.println(rs.getInt(1)+" "+rs.getString(2));
}
www.webstackacademy.com
Closing Connection
● By closing connection object statement and ResultSet will be closed
automatically. The close() method of Connection interface is used to
close the connection.
● con.close();
www.webstackacademy.com
Connect to MySQL
Database
● Driver class: com.mysql.jdbc.Driver.
● Connection URL: jdbc:mysql://localhost:3306/db_name
● Username: The default username for the mysql database is root.
● Password: Given by the user at the time of installing the mysql
database
● Example:
Connection con=DriverManager.getConnection(
"jdbc:mysql://localhost:3306/sonoo","root","root");
www.webstackacademy.com
Loading the .jar
● Download the MySQL connector.jar from mysql.com
● Paste the mysqlconnector.jar in the lib folder of source directory.
● Set the classpath
www.webstackacademy.com
DriverManager
class
● The DriverManager class acts as an interface between user and
drivers.
● It keeps track of the drivers that are available and handles
establishing a connection between a database and the appropriate
driver.
● Connection con = null;
con=DriverManager.getConnection( "jdbc:mysql://localhost:3306","roo
t","password");
● DriverManager.registerDriver().
www.webstackacademy.com
Connection
Interface
● A Connection is the session between Java application and database.
● The Connection interface is a factory of Statement and
PreparedStatement.
● Object of Connection can be used to get the object of Statement and
PreparedStatement.
www.webstackacademy.com
Connection
Interface
Methods of Connection interface:
● public Statement createStatement(): creates a statement object that
can be used to execute SQL queries.
● public void commit(): saves the changes made since the previous
commit/rollback permanent.
● public void close(): closes the connection and Releases a JDBC
resources immediately.
www.webstackacademy.com
Statement Interface
● The Statement interface provides methods to execute queries with
the database.
● The statement interface is a factory of ResultSet.
● It provides factory method to get the object of ResultSet.
www.webstackacademy.com
Statement Interface
Methods of Statement interface:
● public ResultSet executeQuery(String sql): is used to execute
SELECT query. It returns the object of ResultSet.
● public int executeUpdate(String sql): is used to execute specified
query, it may be create, drop, insert, update, delete etc.
● public boolean execute(String sql): is used to execute queries that
may return multiple results.
www.webstackacademy.com
Statement Interface
Example:
● Statement stmt=con.createStatement();
int result=stmt.executeUpdate("delete from table where id=xy");
System.out.println(result+" records affected");
con.close();
www.webstackacademy.com
ResultSet interface
● The object of ResultSet maintains a cursor pointing to a particular row
of data.
● Initially, cursor points to before the first row.
www.webstackacademy.com
ResultSet Interface
Methods of ResultSet interface:
● public boolean next(): is used to move the cursor to the one row
next from the current position.
● public boolean previous():is used to move the cursor to the one row
previous from the current position.
● public boolean first(): is used to move the cursor to the first row in
result set object.
● public boolean last():is used to move the cursor to the last row in
result set object.
www.webstackacademy.com
ResultSet Interface
Methods of ResultSet interface:
● public int getInt(int columnIndex): is used to return the data of
specified column index of the current row as int.
● public int getInt(String columnName): columnName): is used to
return the data of specified column name of the current row as int.
● public String getString(int columnIndex): is used to return the data
of specified column index of the current row as String.
● public String getString(String columnName): is used to return the
data of specified column name of the current row as String.
www.webstackacademy.com
ResultSet Interface
Example:
● ResultSet rs=stmt.executeQuery("select * from table");
//getting the record of 3rd row
rs.absolute(3);
System.out.println(rs.getString(1)+" "+rs.getString(2)+"
"+rs.getString(3));
con.close();
www.webstackacademy.com
PreparedStatement
Interface
● The PreparedStatement interface is a sub interface of Statement.
● It is used to execute parameterized query.
● Example of parameterized query:
– String sql="insert into emp values(?,?,?)";
www.webstackacademy.com
PreaparedStatement
Interface
Methods of PreparedStatement:
● public void setInt(int paramIndex, int value): sets the integer value to
the given parameter index.
● public void setString(int paramIndex, String value): sets the String
value to the given parameter index.
● public void setFloat(int paramIndex, float value): sets the float value
to the given parameter index.
www.webstackacademy.com
PreparedStatement
Interface
Methods of PreparedStatement:
● public void setDouble(int paramIndex, double value): sets the double
value to the given parameter index.
● public int executeUpdate(): executes the query. It is used for create,
drop, insert, update, delete etc.
● public ResultSet executeQuery(): executes the select query. It returns
an instance of ResultSet.
www.webstackacademy.com
PreparedStatement
Interface
Example:
● PreparedStatement stmt=con.prepareStatement("insert into Emp
values(?,?)");
stmt.setInt(1,101);//1 specifies the first parameter in the query
stmt.setString(2,"Ratan");
int i=stmt.executeUpdate();
System.out.println(i+" records inserted");
www.webstackacademy.com
Questions
Write a program to implement CRUD in a table.
Write a program to implement PreparedStatement?
Web Stack Academy (P) Ltd
#83, Farah Towers,
1st floor,MG Road,
Bangalore – 560001
M: +91-80-4128 9576
T: +91-98862 69112
E: info@www.webstackacademy.com
www.webstackacademy.com

More Related Content

PDF
Jdbc[1]
KEY
JDBC Basics (In 20 Minutes Flat)
PDF
Introduction to JDBC and database access in web applications
PDF
PPS
Jdbc example program with access and MySql
PPTX
Module 5 jdbc.ppt
PPTX
Database Programming
Jdbc[1]
JDBC Basics (In 20 Minutes Flat)
Introduction to JDBC and database access in web applications
Jdbc example program with access and MySql
Module 5 jdbc.ppt
Database Programming

What's hot (20)

PPT
30 5 Database Jdbc
PPT
PPTX
Jdbc
PPT
Executing Sql Commands
PDF
Jdbc tutorial
PPT
9780538745840 ppt ch09
PDF
Lecture17
PPT
Jdbc sasidhar
PPT
9780538745840 ppt ch08
PPTX
PostgreSQL Database Slides
PDF
Sql injection with sqlmap
PPTX
PostgreSQL- An Introduction
PPT
9780538745840 ppt ch10
PPT
SQLMAP Tool Usage - A Heads Up
PPTX
Database Connectivity in PHP
PDF
Performance schema in_my_sql_5.6_pluk2013
PDF
PHP with MySQL
PPT
9780538745840 ppt ch06
PDF
spring-tutorial
PPT
Jdbc day-1
30 5 Database Jdbc
Jdbc
Executing Sql Commands
Jdbc tutorial
9780538745840 ppt ch09
Lecture17
Jdbc sasidhar
9780538745840 ppt ch08
PostgreSQL Database Slides
Sql injection with sqlmap
PostgreSQL- An Introduction
9780538745840 ppt ch10
SQLMAP Tool Usage - A Heads Up
Database Connectivity in PHP
Performance schema in_my_sql_5.6_pluk2013
PHP with MySQL
9780538745840 ppt ch06
spring-tutorial
Jdbc day-1
Ad

Similar to Core Java Programming Language (JSE) : Chapter XIII - JDBC (20)

PPTX
Database connect
PPTX
Jdbc presentation
PPT
JDBC.ppt
PPTX
Jdbc Java Programming
PPTX
Jdbc ppt
PDF
Presentation for java data base connectivity
PPTX
PPTX
jdbcppt.pptx , jdbc ppt jdbc ppt jdbc ppt jdbc ppt jdbc ppt jdbc ppt jdbc ppt
PPTX
Advance Java Programming (CM5I)5.Interacting with-database
PDF
Advance Java Practical file
PPTX
PPTX
Java- JDBC- Mazenet Solution
PPTX
Core jdbc basics
PDF
Unit 5.pdf
PPT
Jdbc oracle
PPTX
Java Data Base Connectivity concepts.pptx
PPTX
Database Access With JDBC
PDF
JDBC programming
PPT
JDBC JAVA DATABASE CONNECTIVITY AND JAVA
Database connect
Jdbc presentation
JDBC.ppt
Jdbc Java Programming
Jdbc ppt
Presentation for java data base connectivity
jdbcppt.pptx , jdbc ppt jdbc ppt jdbc ppt jdbc ppt jdbc ppt jdbc ppt jdbc ppt
Advance Java Programming (CM5I)5.Interacting with-database
Advance Java Practical file
Java- JDBC- Mazenet Solution
Core jdbc basics
Unit 5.pdf
Jdbc oracle
Java Data Base Connectivity concepts.pptx
Database Access With JDBC
JDBC programming
JDBC JAVA DATABASE CONNECTIVITY AND JAVA
Ad

More from WebStackAcademy (20)

PDF
Webstack Academy - Course Demo Webinar and Placement Journey
PDF
WSA: Scaling Web Service to Handle Millions of Requests per Second
PDF
WSA: Course Demo Webinar - Full Stack Developer Course
PDF
Career Building in AI - Technologies, Trends and Opportunities
PDF
Webstack Academy - Internship Kick Off
PDF
Building Your Online Portfolio
PDF
Front-End Developer's Career Roadmap
PDF
Angular - Chapter 9 - Authentication and Authorization
PDF
Angular - Chapter 7 - HTTP Services
PDF
Angular - Chapter 6 - Firebase Integration
PDF
Angular - Chapter 5 - Directives
PDF
Angular - Chapter 4 - Data and Event Handling
PDF
Angular - Chapter 3 - Components
PDF
Angular - Chapter 2 - TypeScript Programming
PDF
Angular - Chapter 1 - Introduction
PDF
JavaScript - Chapter 10 - Strings and Arrays
PDF
JavaScript - Chapter 15 - Debugging Techniques
PDF
JavaScript - Chapter 14 - Form Handling
PDF
JavaScript - Chapter 13 - Browser Object Model(BOM)
PDF
JavaScript - Chapter 12 - Document Object Model
Webstack Academy - Course Demo Webinar and Placement Journey
WSA: Scaling Web Service to Handle Millions of Requests per Second
WSA: Course Demo Webinar - Full Stack Developer Course
Career Building in AI - Technologies, Trends and Opportunities
Webstack Academy - Internship Kick Off
Building Your Online Portfolio
Front-End Developer's Career Roadmap
Angular - Chapter 9 - Authentication and Authorization
Angular - Chapter 7 - HTTP Services
Angular - Chapter 6 - Firebase Integration
Angular - Chapter 5 - Directives
Angular - Chapter 4 - Data and Event Handling
Angular - Chapter 3 - Components
Angular - Chapter 2 - TypeScript Programming
Angular - Chapter 1 - Introduction
JavaScript - Chapter 10 - Strings and Arrays
JavaScript - Chapter 15 - Debugging Techniques
JavaScript - Chapter 14 - Form Handling
JavaScript - Chapter 13 - Browser Object Model(BOM)
JavaScript - Chapter 12 - Document Object Model

Recently uploaded (20)

PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Empathic Computing: Creating Shared Understanding
PPTX
Big Data Technologies - Introduction.pptx
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Spectral efficient network and resource selection model in 5G networks
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Unlocking AI with Model Context Protocol (MCP)
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
Modernizing your data center with Dell and AMD
PDF
CIFDAQ's Market Insight: SEC Turns Pro Crypto
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PPTX
Cloud computing and distributed systems.
Digital-Transformation-Roadmap-for-Companies.pptx
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Empathic Computing: Creating Shared Understanding
Big Data Technologies - Introduction.pptx
Network Security Unit 5.pdf for BCA BBA.
Spectral efficient network and resource selection model in 5G networks
“AI and Expert System Decision Support & Business Intelligence Systems”
Unlocking AI with Model Context Protocol (MCP)
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Modernizing your data center with Dell and AMD
CIFDAQ's Market Insight: SEC Turns Pro Crypto
Mobile App Security Testing_ A Comprehensive Guide.pdf
Reach Out and Touch Someone: Haptics and Empathic Computing
NewMind AI Weekly Chronicles - August'25 Week I
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
Chapter 3 Spatial Domain Image Processing.pdf
Cloud computing and distributed systems.

Core Java Programming Language (JSE) : Chapter XIII - JDBC

  • 3. Definition ● JDBC is a Java-based data access technology (Java Standard Edition platform) from Oracle Corporation. ● This technology is an API for the Java programming language that defines how a client may access a database. ● It provides methods for querying and updating data in a database.
  • 4. www.webstackacademy.com JDBC History ● Before JDBC, ODBC API was used to connect and execute query to the database. ● But ODBC API uses ODBC driver that is written in C language which is platform dependent and unsecured. ● That is why Sun Micro System has defined its own API (JDBC API) that uses JDBC driver written in Java language.
  • 5. www.webstackacademy.com JDBC History ● Sun Microsystems released JDBC as part of JDK 1.1 on February 19, 1997. ● The JDBC classes are contained in the Java package java.sql and javax.sql ● The latest version, JDBC 4.2, and is included in Java SE 8.
  • 6. www.webstackacademy.com API ● The Java API is the set of classes included with the Java Development Environment. These classes are written using the Java language and run on the JVM. The Java API includes everything from collection classes to GUI classes. ● JDBC is also an API.
  • 7. www.webstackacademy.com JDBC Drivers ● JDBC Driver is a software component that enables java application to interact with the database.There are 4 types of JDBC drivers: – Type 1: JDBC-ODBC bridge driver – Type 2: Native-API driver (partially java driver) – Type 3: Network Protocol driver (fully java driver) – Type 4: Thin driver (fully java driver)
  • 8. www.webstackacademy.com Type 1: JDBC-ODBC Bridge Driver ● The JDBC-ODBC bridge driver uses ODBC driver to connect to the database. This is now discouraged because of thin driver.
  • 9. www.webstackacademy.com Type 2: Native-API Driver ● The Native API driver uses the client-side libraries of the database. ● It is not written entirely in Java.
  • 10. www.webstackacademy.com Type 3: Network Protocol Driver ● The Network Protocol driver uses middle ware (application server). ● It is fully written in Java.
  • 11. www.webstackacademy.com Type 4: Thin Driver ● The thin driver converts JDBC calls directly into the vendor-specific database protocol. ● That is why it is known as thin driver. ● It is fully written in Java language. ● Better performance than all other drivers. ● No software is required at client side or server side. ● Disadvantage: Drivers depends on the Database.
  • 12. www.webstackacademy.com Steps to Connect to Database There are 5 steps to connect any java application with the database in java using JDBC. They are as follows: ● Register the driver class ● Creating connection ● Creating statement ● Executing queries ● Closing connection
  • 13. www.webstackacademy.com Registering the Driver ● The forName() method of Class class is used to register the driver class. ● Class.forName("com.mysql.jdbc.Driver");
  • 14. www.webstackacademy.com Creating Connection Object ● The getConnection() method of DriverManager class is used to establish connection with the database. ● Connection con=DriverManager.getConnection( "jdbc:mysql://localhost:3306","roo t","password");
  • 15. www.webstackacademy.com Creating Statement Object ● The createStatement() method of Connection interface is used to create statement. The object of statement is responsible to execute queries with the database. ● Statement stmt=con.createStatement();
  • 16. www.webstackacademy.com Execute Query ● The executeQuery() method of Statement interface is used to execute queries to the database. This method returns the object of ResultSet that can be used to get all the records of a table. ● ResultSet rs=stmt.executeQuery("select * from emp"); while(rs.next()){ System.out.println(rs.getInt(1)+" "+rs.getString(2)); }
  • 17. www.webstackacademy.com Closing Connection ● By closing connection object statement and ResultSet will be closed automatically. The close() method of Connection interface is used to close the connection. ● con.close();
  • 18. www.webstackacademy.com Connect to MySQL Database ● Driver class: com.mysql.jdbc.Driver. ● Connection URL: jdbc:mysql://localhost:3306/db_name ● Username: The default username for the mysql database is root. ● Password: Given by the user at the time of installing the mysql database ● Example: Connection con=DriverManager.getConnection( "jdbc:mysql://localhost:3306/sonoo","root","root");
  • 19. www.webstackacademy.com Loading the .jar ● Download the MySQL connector.jar from mysql.com ● Paste the mysqlconnector.jar in the lib folder of source directory. ● Set the classpath
  • 20. www.webstackacademy.com DriverManager class ● The DriverManager class acts as an interface between user and drivers. ● It keeps track of the drivers that are available and handles establishing a connection between a database and the appropriate driver. ● Connection con = null; con=DriverManager.getConnection( "jdbc:mysql://localhost:3306","roo t","password"); ● DriverManager.registerDriver().
  • 21. www.webstackacademy.com Connection Interface ● A Connection is the session between Java application and database. ● The Connection interface is a factory of Statement and PreparedStatement. ● Object of Connection can be used to get the object of Statement and PreparedStatement.
  • 22. www.webstackacademy.com Connection Interface Methods of Connection interface: ● public Statement createStatement(): creates a statement object that can be used to execute SQL queries. ● public void commit(): saves the changes made since the previous commit/rollback permanent. ● public void close(): closes the connection and Releases a JDBC resources immediately.
  • 23. www.webstackacademy.com Statement Interface ● The Statement interface provides methods to execute queries with the database. ● The statement interface is a factory of ResultSet. ● It provides factory method to get the object of ResultSet.
  • 24. www.webstackacademy.com Statement Interface Methods of Statement interface: ● public ResultSet executeQuery(String sql): is used to execute SELECT query. It returns the object of ResultSet. ● public int executeUpdate(String sql): is used to execute specified query, it may be create, drop, insert, update, delete etc. ● public boolean execute(String sql): is used to execute queries that may return multiple results.
  • 25. www.webstackacademy.com Statement Interface Example: ● Statement stmt=con.createStatement(); int result=stmt.executeUpdate("delete from table where id=xy"); System.out.println(result+" records affected"); con.close();
  • 26. www.webstackacademy.com ResultSet interface ● The object of ResultSet maintains a cursor pointing to a particular row of data. ● Initially, cursor points to before the first row.
  • 27. www.webstackacademy.com ResultSet Interface Methods of ResultSet interface: ● public boolean next(): is used to move the cursor to the one row next from the current position. ● public boolean previous():is used to move the cursor to the one row previous from the current position. ● public boolean first(): is used to move the cursor to the first row in result set object. ● public boolean last():is used to move the cursor to the last row in result set object.
  • 28. www.webstackacademy.com ResultSet Interface Methods of ResultSet interface: ● public int getInt(int columnIndex): is used to return the data of specified column index of the current row as int. ● public int getInt(String columnName): columnName): is used to return the data of specified column name of the current row as int. ● public String getString(int columnIndex): is used to return the data of specified column index of the current row as String. ● public String getString(String columnName): is used to return the data of specified column name of the current row as String.
  • 29. www.webstackacademy.com ResultSet Interface Example: ● ResultSet rs=stmt.executeQuery("select * from table"); //getting the record of 3rd row rs.absolute(3); System.out.println(rs.getString(1)+" "+rs.getString(2)+" "+rs.getString(3)); con.close();
  • 30. www.webstackacademy.com PreparedStatement Interface ● The PreparedStatement interface is a sub interface of Statement. ● It is used to execute parameterized query. ● Example of parameterized query: – String sql="insert into emp values(?,?,?)";
  • 31. www.webstackacademy.com PreaparedStatement Interface Methods of PreparedStatement: ● public void setInt(int paramIndex, int value): sets the integer value to the given parameter index. ● public void setString(int paramIndex, String value): sets the String value to the given parameter index. ● public void setFloat(int paramIndex, float value): sets the float value to the given parameter index.
  • 32. www.webstackacademy.com PreparedStatement Interface Methods of PreparedStatement: ● public void setDouble(int paramIndex, double value): sets the double value to the given parameter index. ● public int executeUpdate(): executes the query. It is used for create, drop, insert, update, delete etc. ● public ResultSet executeQuery(): executes the select query. It returns an instance of ResultSet.
  • 33. www.webstackacademy.com PreparedStatement Interface Example: ● PreparedStatement stmt=con.prepareStatement("insert into Emp values(?,?)"); stmt.setInt(1,101);//1 specifies the first parameter in the query stmt.setString(2,"Ratan"); int i=stmt.executeUpdate(); System.out.println(i+" records inserted");
  • 34. www.webstackacademy.com Questions Write a program to implement CRUD in a table. Write a program to implement PreparedStatement?
  • 35. Web Stack Academy (P) Ltd #83, Farah Towers, 1st floor,MG Road, Bangalore – 560001 M: +91-80-4128 9576 T: +91-98862 69112 E: [email protected] www.webstackacademy.com