JDBC is a Java API that allows Java programs to connect to databases. It includes interfaces, classes, and drivers. The document discusses JDBC architecture and components like drivers, interfaces, and classes. It also explains the steps to connect to a database like MySQL using JDBC - registering the driver class, getting a connection, creating statements, executing queries, and closing the connection. Additional topics covered include prepared statements and result sets.
JSP technology has facilitated the segregation of the work of a Web designer and a Web developer.
A Web designer can design and formulate the layout for the Web page by using HTML.
On the other hand, a Web developer working independently can use java code and other JSP specific tags to code the business logic.
The simultaneous construction of the static and dynamic content facilitates development of quality applications with increased productivity.
JSP technology has facilitated the segregation of the work of a Web designer and a Web developer.
A Web designer can design and formulate the layout for the Web page by using HTML.
On the other hand, a Web developer working independently can use java code and other JSP specific tags to code the business logic.
The simultaneous construction of the static and dynamic content facilitates development of quality applications with increased productivity.
oops concept in java | object oriented programming in javaCPD INDIA
object oriented programming is a key concept for the development of application in windows as well as web based application environment. oops concept maps real world through its concept of classes, objects, inheritance, polymorphism which help in making a robust application.
Collections Framework is a unified architecture for managing collections, Main Parts of Collections Framework
1. Interfaces :- Core interfaces defining common functionality exhibited by collections
2. Implementations :- Concrete classes of the core interfaces providing data structures
3. Operations :- Methods that perform various operations on collections
JDBC stands for Java Database Connectivity. JDBC is a Java API to connect and execute the query with the database. It is a part of JavaSE (Java Standard Edition). JDBC API uses JDBC drivers to connect with the database
Before JDBC, ODBC API was the database API to connect and execute the query with the database. But, ODBC API uses ODBC driver which is written in C language (i.e. platform dependent and unsecured). That is why Java has defined its own API (JDBC API) that uses JDBC drivers (written in Java language).
We can use JDBC API to handle database using Java program and can perform the following activities:
Connect to the database
Execute queries and update statements to the database
Retrieve the result received from the database.
oops concept in java | object oriented programming in javaCPD INDIA
object oriented programming is a key concept for the development of application in windows as well as web based application environment. oops concept maps real world through its concept of classes, objects, inheritance, polymorphism which help in making a robust application.
Collections Framework is a unified architecture for managing collections, Main Parts of Collections Framework
1. Interfaces :- Core interfaces defining common functionality exhibited by collections
2. Implementations :- Concrete classes of the core interfaces providing data structures
3. Operations :- Methods that perform various operations on collections
JDBC stands for Java Database Connectivity. JDBC is a Java API to connect and execute the query with the database. It is a part of JavaSE (Java Standard Edition). JDBC API uses JDBC drivers to connect with the database
Before JDBC, ODBC API was the database API to connect and execute the query with the database. But, ODBC API uses ODBC driver which is written in C language (i.e. platform dependent and unsecured). That is why Java has defined its own API (JDBC API) that uses JDBC drivers (written in Java language).
We can use JDBC API to handle database using Java program and can perform the following activities:
Connect to the database
Execute queries and update statements to the database
Retrieve the result received from the database.
JDBC : Java Database Connectivity
JDBC is used to connect java application with database.
JDBC is an API used to communicate Java application to database in database independent and platform independent manner.
It provides classes and interfaces to connect or communicate Java application with database.
Java applications cannot directly communicate with a database to submit data and retrieve the results of queries.
This is because a database can interpret only SQL statements and not Java language statements.
For this reason, you need a mechanism to translate Java statements into SQL statements.
The JDBC architecture provides the mechanism for this kind of translation.
The JDBC architecture can be classified into two layers :
JDBC application layer.
JDBC driver layer.
JDBC application layer : Signifies a Java application that uses the JDBC API to interact with the JDBC drivers. A JDBC driver is software that a Java application uses to access a database. The JDBC driver manager of JDBC API connects the Java application to the driver.
JDBC driver layer : Acts as an interface between a Java applications and a database. This layer contains a driver , such as a SQL server driver or an Oracle driver , which enables connectivity to a database.
A driver sends the request of a Java application to the database. After processing the request, the database sends the response back to the driver. The driver translates and sends the response to the JDBC API. The JDBC API forwards it to the Java application.
Acetabularia Information For Class 9 .docxvaibhavrinwa19
Acetabularia acetabulum is a single-celled green alga that in its vegetative state is morphologically differentiated into a basal rhizoid and an axially elongated stalk, which bears whorls of branching hairs. The single diploid nucleus resides in the rhizoid.
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdfTechSoup
In this webinar you will learn how your organization can access TechSoup's wide variety of product discount and donation programs. From hardware to software, we'll give you a tour of the tools available to help your nonprofit with productivity, collaboration, financial management, donor tracking, security, and more.
2024.06.01 Introducing a competency framework for languag learning materials ...Sandy Millin
http://sandymillin.wordpress.com/iateflwebinar2024
Published classroom materials form the basis of syllabuses, drive teacher professional development, and have a potentially huge influence on learners, teachers and education systems. All teachers also create their own materials, whether a few sentences on a blackboard, a highly-structured fully-realised online course, or anything in between. Despite this, the knowledge and skills needed to create effective language learning materials are rarely part of teacher training, and are mostly learnt by trial and error.
Knowledge and skills frameworks, generally called competency frameworks, for ELT teachers, trainers and managers have existed for a few years now. However, until I created one for my MA dissertation, there wasn’t one drawing together what we need to know and do to be able to effectively produce language learning materials.
This webinar will introduce you to my framework, highlighting the key competencies I identified from my research. It will also show how anybody involved in language teaching (any language, not just English!), teacher training, managing schools or developing language learning materials can benefit from using the framework.
Operation “Blue Star” is the only event in the history of Independent India where the state went into war with its own people. Even after about 40 years it is not clear if it was culmination of states anger over people of the region, a political game of power or start of dictatorial chapter in the democratic setup.
The people of Punjab felt alienated from main stream due to denial of their just demands during a long democratic struggle since independence. As it happen all over the word, it led to militant struggle with great loss of lives of military, police and civilian personnel. Killing of Indira Gandhi and massacre of innocent Sikhs in Delhi and other India cities was also associated with this movement.
Instructions for Submissions thorugh G- Classroom.pptxJheel Barad
This presentation provides a briefing on how to upload submissions and documents in Google Classroom. It was prepared as part of an orientation for new Sainik School in-service teacher trainees. As a training officer, my goal is to ensure that you are comfortable and proficient with this essential tool for managing assignments and fostering student engagement.
1. JDBC – Java Database Connectivity
Session – 1
What is JDBC?
JDBC General Architecture
JDBC API components
JDBC Drivers,
JDBC Driver Types
JDBC Interfaces, Classes
JDBC Connectivity Steps
Connectivity with MySQL
Connection
CRUD Operations
Prepared Statement
Updateable ResultSet
By Jainul Musani
2. JDBC – Java Database Connectivity
What is JDBC ?
To connect Java Applications with Database.
JDBC is a Java API to connect and execute the query
with the database.
It is a part of JavaSE (Java Standard Edition).
JDBC API uses JDBC drivers to connect with the
database.
By Jainul Musani
6. JDBC – Java Database Connectivity
JDBC API components
The java.sql package contains classes and interfaces for
JDBC API.
JDBC Drivers
JDBC Interfaces
JDBC Classes
By Jainul Musani
7. JDBC – Java Database Connectivity
JDBC Drivers
There are four types of JDBC drivers:
1) JDBC-ODBC Bridge Driver,
2) Native Driver,
3) Network Protocol Driver, and
4) Thin Driver
By Jainul Musani
8. JDBC – Java Database Connectivity
1) Driver interface
2) Connection interface
3) Statement interface
4) PreparedStatement
interface
5) CallableStatement
interface
6) ResultSet interface
7) ResultSetMetaData
interface
8) DatabaseMetaData
interface
9) RowSet interface
By Jainul Musani
JDBC Interfaces
There are Nine types of JDBC Interfaces:
9. JDBC – Java Database Connectivity
DriverManager class
Blob class
Clob class
Types class
By Jainul Musani
JDBC Classes
10. JDBC – Java Database Connectivity
JDBC Drivers : JDBC-ODBC Bridge Driver
By Jainul Musani
The JDBC-ODBC bridge driver uses
ODBC driver to connect to the
database.
The JDBC-ODBC bridge driver converts
JDBC method calls into the ODBC
function calls. This is now discouraged
because of thin driver.
11. JDBC – Java Database Connectivity
JDBC Drivers : Native API Driver
The Native API driver uses the
client-side libraries of the
database. The driver converts
JDBC method calls into native
calls of the database API. It is
not written entirely in java.
Advantage:
o performance upgraded than
JDBC-ODBC bridge driver.
Disadvantage:
o The Native driver needs to be
installed on the each client
machine.
o The Vendor client library needs
to be installed on client
machine.
By Jainul Musani
12. JDBC – Java Database Connectivity
JDBC Drivers : Network Protocol Driver
By Jainul Musani
The Network Protocol driver uses
middleware (application server) that
converts JDBC calls directly or
indirectly into the vendor-specific
database protocol. It is fully
written in java.
Advantage: No client side library is
required
Disadvantages:
Network support is required on client
machine.
Requires database-specific coding to
be done in the middle tier.
13. JDBC – Java Database Connectivity
JDBC Drivers : Thin Driver
By Jainul Musani
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.
Advantage:
Better performance than all other
drivers.
No software is required at client
side or server side.
Disadvantage:
Drivers depend on the Database.
14. JDBC – Java Database Connectivity
1) Register the Driver class
2) Create connection
3) Create statement
4) Execute queries
5) Close connection
By Jainul Musani
Java Database Connectivity Steps:
15. JDBC – Java Database Connectivity
Oracle: download the jar file ojdbc14.jar
MySQL: download the jar file mysql-connector.jar
Two ways to load the jar file:
1) paste the ojdbc14.jar file in jre/lib/ext folder
2) set classpath
https://www.soapui.org/docs/jdbc/reference/jdbc-drivers/
By Jainul Musani
Download and Setup the drivers
16. JDBC – Java Database Connectivity
The forName() method of Class class is used to register the
driver class.
This method is used to dynamically load the driver class.
Syntax:
public static void forName(String className) throws
ClassNotFoundException
By Jainul Musani
Step:1: Register the Driver Class
17. JDBC – Java Database Connectivity
Example:
Loading Oracle Driver
Class.forName("oracle.jdbc.driver.OracleDriver");
Loading MySQL Driver
Class.forName("com.mysql.jdbc.Driver");
https://www.soapui.org/docs/jdbc/reference/jdbc-drivers/
By Jainul Musani
Step:1: Register the Driver Class
18. JDBC – Java Database Connectivity
try{
Class.forName("com.mysql.jdbc.Driver");
} catch (ClassNotFoundException e) {
System.out.println("MySQL JDBC Driver not found !!");
return;
}
System.out.println("MySQL JDBC Driver Registered!");
By Jainul Musani
Step:1: Register the Driver Class
19. JDBC – Java Database Connectivity
The getConnection() method of DriverManager class is used
to establish connection with the database.
Syntax:
public static Connection getConnection(String url) throws
SQLException
public static Connection getConnection(String url, String
name, String password) throws SQLException
By Jainul Musani
Step:2: Create connection Object
24. JDBC – Java Database Connectivity
ResultSet rs =
selectStmt.executeQuery(
“Select StudID, StudName, Subject, Marsk From Students
Where StudID Between 101 And 150");
while(rs.next())
{
System.out.println(rs.getString(1)); //First Column
System.out.println(rs.getString(2)); //Second Column
System.out.println(rs.getString(3)); //Third Column
System.out.println(rs.getString(4)); //Fourth Column
}
By Jainul Musani
Fetch the data from result set
25. JDBC – Java Database Connectivity
Connection con = null;
PreparedStatement pstmt = null;
String sql = “Insert into Students
(StudID,StudName,Subject,Marks)
VALUES (?,?,?,?)";
pstmt = con.PreparedStatement(sql);
By Jainul Musani
JDBC PreparedStatement