JavaSE-27 JDBC

Source: Internet
Author: User

Learning Essentials
    • Jdbc
    • Querying data
    • Add data
    • modifying data
    • Delete data

Definition of JDBC1 JDBC

JDBC is the abbreviation for Java Database Connectivity technology, providing the ability to connect and manipulate a variety of commonly used databases.

2 How JDBC Works

3 JDBC API

JDBC API main functions: Establish a connection with the database, execute SQL statements, and process the results.

    • DriverManager: Depending on the database, the JDBC driver is managed
    • Connection: Responsible for connecting to the database and serving the task of transmitting data
    • Statement: Generated by Connection, responsible for executing SQL statements
    • ResultSet: Responsible for saving the results of the query resulting from statement execution
4 JDBC Work templates

Use the statement object to process the SQL statement.

JDBC Query data

Use the PreparedStatement object to process SQL statements (SQL statements are precompiled, more secure).

JDBC Add data

JDBC Modifies data

Using the PreparedStatement object's executeupdate (), returns the number of rows affected, with the work template adding data.

JDBC Deletes data

Using the PreparedStatement object's executeupdate (), returns the number of rows affected, with the work template adding data.

JavaSE-27 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.