Content deleted Content added
Mindmatrix (talk | contribs) revert - rm promotional link disguised as a ref |
→Functionality: Weird placement |
||
Line 45:
==Functionality==
JDBC ('Java Database Connectivity') allows multiple implementations to exist and be used by the same application. The API provides a mechanism for dynamically loading the correct Java packages and registering them with the JDBC Driver Manager. The Driver Manager is used as a connection factory for creating JDBC connections.▼
JDBC connections support creating and executing statements. These may be update statements such as SQL's [[Create (SQL)|CREATE]], [[Insert (SQL)|INSERT]], [[Update (SQL)|UPDATE]] and [[Delete (SQL)|DELETE]], or they may be query statements such as [[Select (SQL)|SELECT]]. Additionally, stored procedures may be invoked through a JDBC connection. JDBC represents statements using one of the following classes:▼
* {{Javadoc:SE|java/sql|Statement}} – the statement is sent to the database server each and every time.▼
* {{Javadoc:SE|java/sql|PreparedStatement}} – the statement is cached and then the [[Query plan|execution path]] is pre-determined on the database server allowing it to be executed multiple times in an efficient manner.▼
* {{Javadoc:SE|java/sql|CallableStatement}} – used for executing [[stored procedures]] on the database.▼
Update statements such as INSERT, UPDATE and DELETE return an update count that indicates how many [[Row (database)|rows]] were affected in the database. These statements do not return any other information.▼
Query statements return a JDBC row result set. The row result set is used to walk over the [[result set]]. Individual [[Column (database)|columns]] in a row are retrieved either by name or by column number. There may be any number of rows in the result set. The row result set has metadata that describes the names of the columns and their types.▼
There is an extension to the basic JDBC API in the {{Javadoc:SE|package=javax.sql|javax/sql}}.▼
JDBC connections are often managed via a [[connection pool]] rather than obtained directly from the driver.▼
{| class="wikitable floatright"
|+ Host database types which Java can convert to with a function
Line 115 ⟶ 100:
|}
▲JDBC ('Java Database Connectivity') allows multiple implementations to exist and be used by the same application. The API provides a mechanism for dynamically loading the correct Java packages and registering them with the JDBC Driver Manager. The Driver Manager is used as a connection factory for creating JDBC connections.
▲JDBC connections support creating and executing statements. These may be update statements such as SQL's [[Create (SQL)|CREATE]], [[Insert (SQL)|INSERT]], [[Update (SQL)|UPDATE]] and [[Delete (SQL)|DELETE]], or they may be query statements such as [[Select (SQL)|SELECT]]. Additionally, stored procedures may be invoked through a JDBC connection. JDBC represents statements using one of the following classes:
▲* {{Javadoc:SE|java/sql|Statement}} – the statement is sent to the database server each and every time.
▲* {{Javadoc:SE|java/sql|PreparedStatement}} – the statement is cached and then the [[Query plan|execution path]] is pre-determined on the database server allowing it to be executed multiple times in an efficient manner.
▲* {{Javadoc:SE|java/sql|CallableStatement}} – used for executing [[stored procedures]] on the database.
▲Update statements such as INSERT, UPDATE and DELETE return an update count that indicates how many [[Row (database)|rows]] were affected in the database. These statements do not return any other information.
▲Query statements return a JDBC row result set. The row result set is used to walk over the [[result set]]. Individual [[Column (database)|columns]] in a row are retrieved either by name or by column number. There may be any number of rows in the result set. The row result set has metadata that describes the names of the columns and their types.
▲There is an extension to the basic JDBC API in the {{Javadoc:SE|package=javax.sql|javax/sql}}.
▲JDBC connections are often managed via a [[connection pool]] rather than obtained directly from the driver.
==Examples==
|