UNIT 6_DATABASE jpr notes
UNIT 6_DATABASE jpr notes
INTERACTING WITH
DATABASE
ODBC
ODBC stands for Open Database
Connectivity
A standard or open application
Connection Interface
Statement Interface
ResultSet Interface
COMMON JDBC COMPONENTS
DriverManager Class
The DriverManager class acts as an interface
Method Description
Method Description
ResultSet.
Commonly used methods of Statement interface
Method Description
public ResultSet
used to execute SELECT query.
executeQuery(String It returns the object of ResultSet.
sql);
public int used to execute specified query,
executeUpdate(String it may be create, drop, insert,
sql); update, delete etc.
a statement.
The object of ResultSet maintains a cursor pointing
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.
public boolean absolute(int is used to move the cursor to the specified row
number in the ResultSet object.
row);
public int getInt(int is used to return the data of specified column
index of the current row as int.
columnIndex);
public int getInt(String is used to return the data of specified column
name of the current row as int.
columnName);
public String getString(int is used to return the data of specified column
index of the current row as String.
columnIndex);
public String is used to return the data of specified column
name of the current row as String.
getString(String