Java Programming Tutorial Chapter 10 JDBC Programming Technique Exercises

1. Common large-scale relational database products include oracle 9i/10g/11g of Oracle Corporation, DB/2 of IBM Corporation; SQL server 2000/2005/2008 of Microsoft Corporation, and ASE of Sybase Corporation. 2, the most popular in the
world The current relational database system is SQL 3, and the JDBC API provided in JDK is mainly included in java
.
Add it to the Build Path of the Java project. If it is in Dos and Linux, it is added to the environment variable as the class path.
5. In the database URL "jdbc:MySQL://localhost:3306/test", 3306 represents the port, and Indicates the database name.
6. In JDBC programming, use the Statement class to implement static SQL statement programming, use the PreparedStatement class to implement SQL statement programming with parameters, and use the CallableStaement class to implement stored procedure programming. 7. In JDBC programming, set conn.setAutoCommit(false
) Start the transaction, execute conn.commit() to commit the transaction after the transaction is executed, otherwise all rollback() rollback or rollback to the specified breakpoint.
8. Common data persistence technologies include JDBC, Spring JDBCTemplate, MyBatis, Hibernate.
9. Briefly describe the steps of JDBC database programming:
    1. Download the JDBC program driver and add it to the classpath or buildpath
    2. Register the driver
    3. Obtain the database connection
    4. Get the database operation object
    5. Execute the sql statement
    6. Process the query result set
    7. Close the connection and release the resource

Guess you like

Origin blog.csdn.net/weixin_54645719/article/details/126151336