DbUtils – JDBC Utility Component
Apache Commons DbUtils ™
Last Published: 15 September 2023
Version: 1.8.1
ApacheCon
Apache
Commons
DbUtils
Overview
Examples
Release Notes
Dependencies
Wiki
Development
Mailing Lists
Issue Tracking
Source Repository
Building
Javadoc
Javadoc Archive
Project Documentation
Project Information
About
Summary
Team
Source Code Management
Issue Management
Mailing Lists
Dependency Information
Dependency Management
Dependencies
Dependency Convergence
CI Management
Distribution Management
Project Reports
Commons
License
Components
Sandbox
Dormant
General Information
Security
Volunteering
Contributing Patches
Building Components
Commons Parent POM
Commons Build Plugin
Commons Release Plugin
Site Publication
Releasing Components
Wiki
ASF
How the ASF works
Get Involved
Developer Resources
Code of Conduct
Sponsorship
Thanks
Commons DbUtils: JDBC Utility Component
The Commons DbUtils library is a small set of classes designed to make working with
JDBC
easier. JDBC
resource cleanup code is mundane, error prone work so these classes
abstract out all of the cleanup tasks from your code leaving you with
what you really wanted to do with JDBC in the first place: query and
update data.
Some of the advantages of using DbUtils are:
No possibility for resource leaks. Correct JDBC coding isn't
difficult but it is time-consuming and tedious. This often
leads to connection leaks that may be difficult to track down.
Cleaner, clearer persistence code. The amount of code needed
to persist data in a database is drastically reduced. The remaining
code clearly expresses your intention without being cluttered
with resource cleanup.
Automatically populate JavaBean properties from ResultSets. You
don't need to manually copy column values into bean instances
by calling setter methods. Each row of the ResultSet can be
represented by one fully populated bean instance.
Scope of the Package
DbUtils is designed to be:
Small
- you should be able to understand the
whole package in a short amount of time.
Transparent
- DbUtils doesn't do any magic
behind the scenes. You give it a query, it executes it and
cleans up for you.
Fast
- You don't need to create a million
temporary objects to work with DbUtils.
DbUtils is
not
An Object/Relational bridge - there are plenty of good O/R tools
already. DbUtils is for developers looking to use JDBC without all
the mundane pieces.
A Data Access Object (DAO) framework - DbUtils can be used to build
a DAO framework though.
An object oriented abstraction of general database
objects like a Table, Column, or PrimaryKey.
A heavyweight framework of any kind - the goal here is to be a
straightforward and easy to use JDBC helper library.
Example Usage
Please see
Examples Page
Dependencies
DbUtils is intentionally a single jar distribution and relies only on
a standard Java 8 or later JRE.
Copyright © 2002-2023
The Apache Software Foundation
Apache Commons, Apache Commons DbUtils, Apache, the Apache feather logo, and the Apache Commons project logos are trademarks of The Apache Software Foundation.
All other marks mentioned may be trademarks or registered trademarks of their respective owners.
US