Using Select Statements in JDBC

Ads

The SELECT statement is used to select data from a table. For terminating a statement, semicolon is used.

Using Select Statements in JDBC

The
SELECT statement is used to select data from a table. For terminating a statement,
semicolon is used.
When we want to fetch the data from any table then we have to use
SELECT statement. The Query can be written as below:

SELECT * FROM employee;

This Example
SelectState.java is concern with Select Statements. You have to just
create the connection with database and execute the Select
Statement.

Description
of the programIn this
program, we will learn how to retrieve the data from any table with the
JDBC. Employee is the name of a table and Name is one of the column of table. By the SELECT Statement we can
retrieve the data.

Description
of Code1.First in the program we import the java.sql
package then define the SelectState class.