Dbutils Using transactions

Source: Internet
Author: User
1.DBUtils is a database operation utility in Java programming, small and simple and practical, how does it manage things?

We all know that in JDBC, things are controlled by connection objects.

One of the core classes of the Dbutils tool class is Queryrunner

The main explanation here is that empty constructors and parameters are the constructors of the link pool.

parameter is the constructor of the link pool, we give the link to dbutils to manage, the thing also to Dbutils to manage, adopt the MySQL default to manage the way of the thing, a SQL language one commits
Queryrunner (DataSource DS)
Update (String sql, Object ... params)
Query (String sql, resultsethandler<t> rsh, Object ... params)
These three SQL statements should be put together.

The empty constructor, the link is to the developer to manage, the thing is also to the developer to manage, need to manually commit and rollback things
Queryrunner ()--indicates that the underlying does not manage the connection for you, manage the connection yourself
Update (Connection conn, String sql, Object ... params)
Query (Connection conn, String sql, resultsethandler<t> rsh, Object ... params)
These three SQL statements should be used together.

Dbutils Using transactions

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.