Java Basics-006

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.