37.JDBC
JDBC is an abstraction layer that allows users to choose between different databases. JDBC allows developers to write database references in Java without needing to be concerned with the specifics of a particular database at the bottom.
38. Driver (Driver) role in JDBC
The JDBC driver provides a specific vendor implementation of the JDBC API interface class, and the driver must provide a specific implementation of these classes under the java.sql package: Connection, statement, PreparedStatement, CallableStatement, ResultSet and Driver
PreparedStatement is precompiled, so performance is better. At the same time, different query parameter values, PreparedStatement can be reused. So PreparedStatement has an advantage over statement.
the use of callablesratement.
CallableStatement is used to execute stored procedures. Stored procedures are stored and provided by the database. Stored procedures can accept input parameters, or they can have return results. The use of stored procedures is highly encouraged because it provides security and modularity. The way to prepare a callablestatement is: Callablestatement.preparecall ();
40. Database Connection Pool
Like opening the database connection pool, this interaction with the database can be time-consuming, especially when the server starts up, consumes a lot of resources, and the cost is very high. Multiple database connections can be established and maintained in a pool when the app service is started. Connection requests are provided by connections in the pool. After the connection has been used, the connection is returned to the pool in order to satisfy more requests in the future.
Java Basics-006