Home » Core Java » sql » Page 9

sql

Determine if a ResultSet is updatable

With this example we are going to demonstrate how to determine if a ResultSet is updatable. An updatable ResultSet is a table of data representing a database result set, that can be updated by others. In short, to determine if a ResultSet is updatable you should: Load the JDBC Driver, using the forName(String className) API method of the Class. In ...

Read More »

Determine if a database supports Updatable ResultSets

This is an example of how to determine if a database supports updatable ResultSets. When a database supports updatable ResultSets it means that modification to data in a table is allowed through a result set. Checking if a database supports updatable ResultSets implies that you should: Load the JDBC driver, using the ForName(String className) API method of the Class. In ...

Read More »

Updatable ResultSet Example

In this example we shall show you how to use an updatable ResultSet. An updatable result set allows modification to data in a table through the result set. To create an Updatable ResultSet and use its capabilites for data updates in a database one should perform the following steps: Load the JDBC driver, using the forName(String className) API method of ...

Read More »

Determine if a database supports Scrollable ResultSets

With this example we are going to demonstrate how to determine if a database supports scrollable ResultSets. Values captured in an insentitive scrollable result set never change, even if changes are made to the table from which the data was retrieved, whereas a sensitive scrollable result set is one where the current values in the table are reflected in the ...

Read More »

Determine if a ResultSet is scrollable

This is an example of how to determine if a ResultSet is Scrollable. Checking if a ResultSet is scrollable or not implies that you should: Load the JDBC driver, using the forName(String className) API method of the Class. In this example we use the MySQL JDBC driver. Create a Connection to the database. Invoke the getConnection(String url, String user, String ...

Read More »

Scrollable ResultSet example

In this example we shall show you how to create and use a scrollable ResultSet. To use a scrollable ResultSet one should perform the following steps: Load the JDBC driver, using the forName(String className) API method of the Class. In this example we use the MySQL JDBC driver. Create a Connection to the database. Invoke the getConnection(String url, String user, ...

Read More »

Getting column names of a database table

With this example we are going to demonstrate how to get the column names of a database Table. In short, to get the column names of a database Table you should: Load the JDBC driver, using the forName(String className) API method of the Class. In this example we use the MySQL JDBC driver. Create a Connection to the database. Invoke ...

Read More »

Retrieve data example

This is an example of how to retrieve data from a database. Retrieving data from a database implies that you should: Load the JDBC driver, using the forName(String className) API method of the Class. In this example we use the MySQL JDBC driver. Create a Connection to the database. Invoke the getConnection(String url, String user, String password) API method of ...

Read More »

Update a table row example

In this example we shall show you how to update a Table row. To update a Table row one should perform the following steps: Load the JDBC driver, using the forName(String className) API method of the Class. In this example we use the MySQL JDBC driver. Create a Connection to the database. Invoke the getConnection(String url, String user, String password) ...

Read More »

Insert a row into a table example

With this example we are going to demonstrate how to insert a row into a table. We can insert rows to a table with the Statement or the PreparedStatement API, according to the frequency of inserted rows. In short, to insert a row into a table you should: Load the JDBC driver, using the forName(String className) API method of the ...

Read More »