An introduction to JDBC, JNDI and Spring JDBC with Tomcat

An introduction to JDBC, JNDI and Spring JDBC with Tomcat

30-days Money-Back Guarantee

Updated on Sep, 2026

Programming, Programming Languages,

Duration - 3.5 hours

Training 5 or more people ?

Get your team access to 10000+ top Tutorials Point courses anytime, anywhere.

Data Access with Spring JDBC Support using JNDI in an embedded Tomcat Server .

Course Introduction - JDBC History & Sample User Story

Our Spring JDBC Development Environment

Connecting to the Database

DAO with Traditional JDBC vs Spring JDBC

Full CRUD with Spring JDBC Template example

Why learn Spring JDBC ?

JDBC use is widespread in large companies worldwide

Actively maintained for 20+ years and counting

Spring JDBC gives you a “quick win” when dealing with legacy JDBC code

Spring JDBC - Sample User Story

As an expatriate living abroad I want access to an online database of all charities (non-profits) that operate in my “home country”.

I want to be able to find Charities by their Tax Id

I want to be able to search by Charity Category such as Environment or Education

I want to be able to search by Charity Program Types

Connecting to the MariaDB with JDBC

Establishing a Connection

Using the DriverManager Class

Specify the database Connection URLs

Connecting to the MariaDB with Spring:

Define Spring DataSource Bean to get a DB Connection

Specify the database properties in application.xml

Using the MariaDB DataSource Bean Class

Connecting to the MariaDB :

Using JNDI DataSource Objects to Get a Connection

Registering DataSource Object with Naming Service That Uses JNDI API

Creating Instance of DataSource Class and Setting its Properties

Using Deployed DataSource Object

Using JNDI to Get a JDBC Connection in Embedded Tomcat

Java Main Method to launch Embedded Tomcat

Registering DataSource Object with JNDI API

Using the registered JNDI DataSource Object

Running the JAR with Maven Plugin

Using Spring App Context to Get a JDBC Connection Tomcat

Defining the DataSource in Spring application.xml

Adding a context listener to web.xml

Retrieve the Spring Data Source bean in the Servlet

Using Spring Annotation Config in Embedded Tomcat

Defining the DataSource in Spring Config Class

Retrieve the Spring DataSource bean in the Servlet

Check out the detailed breakdown of what’s inside the course

Accomplished in the full life cycle of software design from requirements definition, prototyping, proof of concept through to implementation, testing, maintenance and system enhancements.

Java 11, SQL, XML, JavaScript

Apache Camel, Spring Boot , JDBC, Mockito, Spring Security , Spring Data - JPA, Junit, Redis, RabbitMQ, ActiveMQ

RAML, REST/Json, Eclipse SWT, JavaBeans, JSP, Servlets, EJB 2.1, Collections, JTA, JDBC, Eclipse Platform SDK

OOA/OOD (UML, Design Patterns, Re-factoring), SOA, Micro Services, Unit Testing, Mock Objects, RUP, Agile, Scrum, TDD

Jboss AS, IBM Webshpere, Equinox OSGI, BEA Weblogic, Tomcat, OpenCMS

Release Tools Docker, Maven, Bamboo, Subversion, Jira, Ant, CVS, Git, Rational Suite

IntelliJ IDEA, Eclipse, Spring Tool Suite

Databases Mongo DB, Oracle, MS SQL Server, MySQL

Use your certificate to make a career change or to advance in your current career.

Become a valued member of Tutorials Point and enjoy unlimited access to our vast library of top-rated Video Courses

Master prominent technologies at full length and become a valued certified professional.

Recommended articles