[JAVA学习笔记-74]了解JDBC

xiaoxiao2021-02-28  127

JDBC provides methods to query and update data in a database. dynamically loading the correct Java packages and registerting them with the JDBC Driver Manager, the JDBC Driver Manager is used as a connection factory for creating connections.

JDBC connections support creating and executing statements.Statements can be update(CREATE,INSERT,UPDATE,DELETE) and query(SELECT).

Statement – the statement is sent to the database server each and every time.

PreparedStatement – the statement is cached and then the execution path is pre-determined on the database server allowing it to be executed multiple times in an efficient manner.

CallableStatement – used for executing stored procedures on the database.

Update statements return an update count that indicates how many rows were affected in the database.

Query statements return a JDBC row result set.

JDBC connections are often managed via a connection pool rather than obtained directly from the driver.

转载请注明原文地址: https://www.6miu.com/read-42516.html

最新回复(0)