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

来源:互联网 发布:文言文乎的用法 编辑:程序博客网 时间:2024/05/18 01:45

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.

原创粉丝点击