Tutorialspoint

April Learning Carnival is here, Use code FEST10 for an extra 10% off

An introduction to JDBC, JNDI and Spring JDBC with Tomcat

person icon Nicolaas C Kock

4

An introduction to JDBC, JNDI and Spring JDBC with Tomcat

Spring JDBC Support

updated on icon Updated on Apr, 2024

language icon Language - English

person icon Nicolaas C Kock

English [CC]

category icon Development,Java Frameworks,JDBC

Lectures -27

Duration -3.5 hours

4

price-loader

30-days Money-Back Guarantee

Training 5 or more people ?

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

Course Description

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

Course Modules :

  • 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

Connecting to the MariaDB :

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

Connecting to the MariaDB :

Using Spring App Context to Get a JDBC Connection Tomcat

  • Java Main Method to launch Embedded Tomcat

  • Defining the DataSource in Spring application.xml

  • Adding a context listener to web.xml

  • Retrieve the Spring Data Source bean in the Servlet

Connecting to the MariaDB :

Using Spring Annotation Config in Embedded Tomcat

  • Java Main Method to launch Embedded Tomcat

  • Defining the DataSource in Spring Config Class

  • Retrieve the Spring DataSource bean in the Servlet

Goals

What will you learn in this course:

  • What is JDBC - Java Database Connectivity
  • What is the difference between Java direct JDBC and Spring JDBC
  • What is a JDBC Connection and an overview of the different types
  • How to set up a JDBC Datasource Connection
  • How to use the Spring JDBC Template to access a relational database
  • Understand JNDI and defining a DB Connection
  • Use Spring Boot to put together an Embedded Tomcat JDBC CRUD Application


Prerequisites

What are the prerequisites for this course?

  • Be familiar with Java Software Development
  • Be familiar with modern Java IDE's such as IntelliJ
  • Be familiar with the concept of a Relational Database
  • A basic understanding of the Maven build tool
  • A basic understanding of Git source control and how to use Github
An introduction to JDBC, JNDI and Spring JDBC with Tomcat

Curriculum

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

Introduction
3 Lectures
  • play icon Course Introduction 03:13 03:13
  • play icon What is JDBC ? 02:17 02:17
  • play icon Our Sample Business Problem 02:17 02:17
Our JDBC Development Environment
12 Lectures
Tutorialspoint
Connecting to the Database with JDBC
6 Lectures
Tutorialspoint
Comparing traditional JDBC with Spring JDBC
6 Lectures
Tutorialspoint

Instructor Details

Nicolaas C Kock

Nicolaas C Kock

e


Course Certificate

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

sample Tutorialspoint certificate

Our students work
with the Best

Related Video Courses

View More

Annual Membership

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

Subscribe now
Annual Membership

Online Certifications

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

Explore Now
Online Certifications

Talk to us

1800-202-0515