Home kellton

Main navigation

  • Services
    • Digital Business Services
      • AI Services
        • Generative Al Services
        • Agentic Al & Automation
        • Traditional Al Solutions
        • Al Engineering & Platforms
        • Al Governance & Risk
        • Data Engineering for Al
      • Digital Experience
        • Product Strategy & Consulting
        • Product Design
        • Product Management
      • Product Engineering
        • Digital Application Development
        • Mobile Engineering
        • IoT & Wearables Solutions
        • Quality Engineering
      • Data & Analytics
        • Data Consulting
        • Data Engineering
        • Data Migration & Modernization
        • Analytics Services
        • Integration & API
      • Cloud Engineering
        • Cloud Consulting
        • Cloud Migration
        • Cloud Managed Services
        • DevSecOps
      • NextGen Services
        • Blockchain
        • Web3
        • Metaverse
        • Digital Signage Solutions
        • Spatial Computing
    • SAP Hide
      • ServiceNow
        • AI Solutions
        • Implementation Services
        • Optimization Services
        • Consulting Services
      • SAP
        • S/4HANA Implementations
        • SAP AMS Support
        • SAP Automation
        • SAP Security & GRC
        • SAP Value Added Solutions
        • Other SAP Implementations
      • View All Services
  • Platforms & Products
    • Hooper
    • Structi.ai
    • Optima
    • KAI SDLC 360
    • tHRive
    • Audit.io
    • Kellton4Commerce
    • Kellton4NFT
    • Our Data Accelerators
      • Digital DataTwin
      • SmartScope
      • DataLift
      • SchemaLift
      • Reconcile360
    • View All Products
  • Industries
    • Fintech, Banking, Financial Services & Insurance
    • Retail, E-Commerce & Distribution
    • Pharma, Healthcare & Life Sciences
    • Non-Profit, Government & Education
    • Travel, Logistics & Hospitality
    • HiTech, SaaS, ISV & Communications
    • Manufacturing, Automotive & Chemicals
    • Oil,Gas & Mining
    • Energy & Utilities
    • View All Industries
  • Our Partners
    • ServiceNow
    • Microsoft
    • AWS
    • SAP
    • View All Partners
  • Insights
    • Blogs
    • Brochures
    • Success Stories
    • News / Announcements
    • Webinars
    • White Papers
  • Careers
    • Job
    • Life At Kellton
  • About
    • About Us
    • Our Leadership
    • Testimonials
    • Analyst Recognitions
    • Investors
    • Privacy-Policy
    • Contact Us
    • Our Delivery Centers
      • India Delivery Center
      • Europe Delivery Center
Search
  1. Home
  2. All Insights
  3. Blogs

What is DAO in Java’s Spring Boot?

Product Engineering
Published On: June 23 , 2015
Updated On: July 7, 2023
Posted By:
Kellton
linkedin
4 min read
What is DAO in Java’s Spring Boot

Other recent blogs

Node.js architecture
Enterprise Node.js Architecture: When & Why CTOs choose Node.js for scalable applications
August 26 , 2026
What's new in Spring Boot
Spring Boot 4 Migration Guide: What’s new features, benefits, and upgrade explained
August 20 , 2026
Top 10 Python web frameworks
Top 10 Python web frameworks for 2026: How enterprise teams should choose the right backend framework
August 11 , 2026

Let's talk

Reach out, we'd love to hear from you!

CAPTCHA
Solve this simple math problem and enter the result. E.g. for 1+3, enter 4.

This article deep dives into what Data Access Object (DAO) is in the Java-based Spring Boot Framework. The motive is to simplify technical niceties and break down the crux in a way that can be well suited to the interested layman. Stay with us!

Explained: DAO or Data Access Object in Java

DAO stands for Data Access Object. It’s a design pattern in which a data access object (DAO) is an object that provides an abstract interface to some type of database or other persistence mechanisms. By mapping application calls to the persistence layer, DAOs provide some specific data operations without exposing details of the database. 

The isolation enabled by DAOs supports the Single responsibility principle. It separates what data accesses the application needs in terms of domain-specific objects and data types (the public interface of the DAO) and how these needs can be satisfied with a specific DBMS, database schema, etc. (the implementation of the DAO).

DAOs in Java can be helpful in situations where you don’t want to leverage the full power of the persistence layer or for cases where you need to make little changes to the underlying database. DAOs prevent developers from having to know SQL (the standard query language for databases), which can make development and debugging much faster and easier.

How Do DAOs support integration?

Need to integrate your enterprise application with a different persistence layer, but you don’t know where to begin? Java provides a comprehensive and modular framework for data access-Spring Boot, coupled with DAO-that makes integrating with different persistent layers easy. 

While developing an enterprise application, one of the most important aspects is to deal with the DB like connection management, transaction management etc. Initialization of data access objects, resource management and transaction management and exception handling are the main parts of the persistence framework. Spring data access framework is provided to integrate with different persistence frameworks like JDBC, Hibernate, JPA, iBatis etc.

Let’s take a deeper look, how JDBC and Spring are set up together to communicate to the database.

  • Setting up the Data Source

Either we can get the data source from JNDI

<bean id=”dataSourceBean” class=”org.springframework.jndi.JndiObjectFactoryBean”>

<property name=”jndiEnvironment”>

<props>

<prop key=”java.naming.initial.factory”>define value</prop>

<prop key=”java.naming.provider.url”>insert URL</prop>

</props>

</property>

<property name=”jndiName” value=”dirName”/>

</bean>

Or we can create the data source in the spring container

<bean id=” dataSourceBean” class=”org.springframework.jdbc.datasource.DriverManagerDataSource”>

<property name=”driverClassName” value=”oracle.jdbc.driver.OracleDriver”/>

<property name=”url” value=”jdbc:oracle:thin:@localhost:1521:XE”/>

<property name=”username” value=”username”/>

<property name=”password” value=”password”/>

</bean>

(BasicDataSource can also be used in place of DriverManagerDataSource)

  • Define the DAO bean

<bean id=”daoBean” class=” daoBean” init-method=”init”>

<constructor-arg ref=” dataSourceBean”/>

</bean>

  • Now write the DAO component to access the data source defined above

public class daoBean {

DataSource dataSourceBean;

Connection conn;

public daoBean (DataSource dataSourceBean){

this. dataSourceBean = dataSourceBean;

}

public void init(){

conn= dataSourceBean.getConnection();

}

public void useConnection(){

System.out.println(conn);

}

}

  • Now let’s write a simple client class to see what we are getting in the connection back

public class daoClient {

public static void main(String args[]){

BeanFactory bf=new FileSystemXmlApplicationContext(“applicationContext.xml”);

daoBean daob=( daoBean)bf.,getBean(“daoBean”);

daob.useConnection();

}

In the next part of this article we’ll explore JdbcTemplate and JdbcDaoSupport classes, what they are and how we can use them.

Want to know more?

Node.js architecture
Blog
Enterprise Node.js Architecture: When & Why CTOs choose Node.js for scalable applications
August 26 , 2026
What's new in Spring Boot
Blog
Spring Boot 4 Migration Guide: What’s new features, benefits, and upgrade explained
August 20 , 2026
Top 10 Python web frameworks
Blog
Top 10 Python web frameworks for 2026: How enterprise teams should choose the right backend framework
August 11 , 2026

North America: +1.844.469.8900

Asia: +91.124.469.8900

Europe: +44.203.807.6911

Email: ask@kellton.com

Footer menu right

  • Services
  • Platforms & Products
  • Industries
  • Insights

Footer Menu Left

  • About
  • News
  • Careers
  • Contact
linkedin LinkedIn twitter Twitter youtube Youtube facebook Facebook
Chatbot
Kellton Kellton Assistant

Feel free to inquire about any Digital Transformation Initiative

Hi there! Welcome to Kellton! It's great to have you here. How can I assist you today?

© 2024 Kellton