Interview Questions-Database-jdbc

Source: Internet
Author: User

1. What is JDBC?

JDBC is an abstraction layer that allows users to choose between different databases. JDBC allows developers to write database applications in Java without needing to be concerned with the specifics of a particular database at the bottom.

2. Explain the role of the drive (Driver) in JDBC.

The JDBC driver provides a specific vendor implementation of the JDBC API interface class, and the driver must provide implementations of these classes under the java.sql package: Connection, Statement, Preparedstatement,callablestatement, ResultSet and driver.

What is the function of the 3.class.forname () method?

Initializes the class specified by the parameter, and returns the class object

What advantages does 4.PreparedStatement have over statement?

Preparedstatements is precompiled, so performance is better. At the same time, different query parameter values, PreparedStatement can be reused.

5. When do I use CallableStatement? What is the method used to prepare the callablestatement?

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 to:
Callablestament.preparecall ();

6. What does the database connection pool mean?

Like open Close database connection this interaction with the database can be time consuming, especially when the number of clients increases, which consumes a lot of resources and costs very high. A number of database connections can be established and maintained in a pool when the application server is started. Connection requests are provided by connections in the pool. After the connection has been used, the connection is returned to the pool for additional requests in the future.

Interview Questions-Database-jdbc

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.