JDBC Java database connection 2) API for JDBC Interface core

Source: Internet
Author: User
Tags driver manager

API for the JDBC interface core

 Java.sql.* and javax.sql.* (java2.0 later updated extensions)

  |-Driver Interface : Represents Java driver interface. All of the specific database vendors are going to implement this interface.

|-Connect (URL, properties): a way to connect to a database.

URL: The URL of the connection database

       URL Syntax: jdbc protocol : Database Sub-protocol :// host : Port / database

        User: Username for database

        Password: Database user password

  |-DriverManager class: Driver Manager class for managing all registered drivers

|-registerdriver (Driver): registering a Driver class object

|-connection getconnection (Url,user,password); Get Connection Object

  |-Connection Interface: represents Java the Connection object for the program and database.

|-Statement createstatement () : Create Statement Object

|-PreparedStatement preparestatement (String sql) creating preparedstatement Objects

|-callablestatement preparecall (String sql) Creating CallableStatement objects

  |-Statement interface: used to execute a static SQL statement

|-int executeupdate (String sql) : performs a static update of the SQL statement (DDL,DML )

|-ResultSet executeQuery (String sql) : Static query SQL statement executed (DQL)

  |-preparedstatement Interface (subclass of statement Interface): Used to perform precompilation SQL Statement

|-int executeupdate () : Perform precompiled update SQL statements (DDL,DML )

|-resultset executeQuery () : execute a precompiled query SQL statement (DQL)

    |-callablestatement Interface (subclass of PreparedStatement Interface): SQL statement for execution of stored procedures (callxxx)

|-resultset executeQuery () : methods for calling stored procedures

  |-resultset interface : Used to encapsulate the data of the query

|-Boolean Next () : Move the cursor to the next line

|-getxx (): Gets the value of the column

JDBC Java database connection 2) API for JDBC Interface core

Related Article

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.