Beruflich Dokumente
Kultur Dokumente
Objectives
Solution:
The user interface of the application should be as shown in the
following figure:
The GUI for the application is created using the
java.swing package. The database operations are
performed using the PreparedStatement object
To solve the above problem, perform the following tasks:
Code the application.
Compile and execute the application.
A transaction:
Is a set of one or more SQL statements that are executed as
a single unit.
Is complete only when all the SQL statements in a
transaction execute successfully.
Maintains consistency of data in a database.
Committing a Transaction:
The commit() method is used to reflect the changes made by
the transactions in a database.
The rollback() method is used to undo the changes made
in the database after the last commit operation.
You need to explicitly invoke commit() and rollback()
methods.
A batch:
Is a group of update statements that are sent to a database
to be executed as a single unit.
Reduces network calls between the application and the
database.
Is a more efficient way as compared to the processing of a
single SQL statement.
Method Description
Method Description
Method Description
Method Description
Problem Statement:
The Manager of New Publishers publishing company,
sometimes require the information about the tables of the
database used by the company. He is not familiar with the SQL
statements, therefore, he has asked you to create an
application to determine the total number of columns and the
data types of the columns of a given table. The table name has
to be specified at the runtime.
Solution:
The getColumnName(), getColumnCount(), and
getColumnTypeName() methods of the ResultSetMetaData
interface are used to develop the above application. To solve
the above problem, perform the following tasks:
1. Code the application.
2. Compile and execute the application.