Tuesday, 26 February 2019

Spring + JdbcTemplate + Update the rows with multiple parameters with object array example

🚀 Boost Your Java Career!

Get the latest Spring tutorials delivered straight to your feed. Join Ram N Java today!

CLICK HERE TO SUBSCRIBE

Updating Multiple Rows with Object Array in Spring JDBC

In this guide, we'll explore a powerful way to update records in your database using Spring JdbcTemplate. Specifically, we'll look at how to handle queries with multiple dynamic parameters using an Object[] array.

The SQL Update Command

When you need to update a row based on multiple conditions, your SQL uses placeholders (?) for each value. For example, changing an employee's name based on their ID and current age:

UPDATE employee SET name = ? WHERE age = ? AND id = ?

Why Use an Object Array?

Spring's update method is overloaded. While you can pass parameters individually, using an Object Array (new Object[] {param1, param2...}) is highly beneficial because:

  • Cleaner Code: It keeps your method calls organized even with 5 or 10 parameters.
  • Flexibility: It easily handles different data types (String, Integer, etc.) in one go.
  • Readability: It's easy for other developers to see exactly which values correspond to which placeholders.

Step-by-Step Implementation

1. Define the SQL: Create a string with your UPDATE statement and ? placeholders.

2. Prepare the Data: Pack your new values into an Object[]. Make sure the order matches the ? in your SQL!

3. Call the Method: Use jdbcTemplate.update(sql, objectArray). Spring handles the rest!

⚠️ Reminder:

Always ensure the order of elements in your Object Array matches the order of placeholders in your SQL string to avoid updating the wrong data!

More from the Spring JDBC Series

Check out these related videos on Ram N Java to master Spring JDBC:


Click here to watch on Youtube:
https://www.youtube.com/watch?v=qKzoZubuBL8&list=UUhwKlOVR041tngjerWxVccw

Click the below Image to Enlarge:
Spring + JdbcTemplate + Update the rows with multiple parameters with object array example
Employee.sql

CREATE DATABASE org_db;


CREATE TABLE `employee` (
  `EMPLOYEE_ID` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
  `NAME` VARCHAR(100) NOT NULL,
  `AGE` INT(10) NOT NULL,
  `SALARY` INT(10) DEFAULT NULL,
  PRIMARY KEY (`EMPLOYEE_ID`)
) ENGINE=INNODB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;


INSERT INTO `employee` (`EMPLOYEE_ID`, `NAME`, `AGE`, `SALARY`) VALUES('1','Peter','28','80000');
INSERT INTO `employee` (`EMPLOYEE_ID`, `NAME`, `AGE`, `SALARY`) VALUES('2','John','50','40000');
INSERT INTO `employee` (`EMPLOYEE_ID`, `NAME`, `AGE`, `SALARY`) VALUES('3','David','45','20000');

pom.xml

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.ram.core</groupId>
    <artifactId>SpringDemo</artifactId>
    <packaging>jar</packaging>
    <version>1.0-SNAPSHOT</version>
    <name>SpringDemo</name>
    <url>http://maven.apache.org</url>

    <properties>
        <spring.version>5.0.5.RELEASE</spring.version>
    </properties>

    <dependencies>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>3.8.1</version>
            <scope>test</scope>
        </dependency>

        <!-- Spring 5 dependencies -->
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-core</artifactId>
            <version>${spring.version}</version>
        </dependency>

        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context</artifactId>
            <version>${spring.version}</version>
        </dependency>

        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-jdbc</artifactId>
            <version>${spring.version}</version>
        </dependency>

        <!-- MySQL database driver -->
        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
            <version>8.0.11</version>
        </dependency>

    </dependencies>

</project>

EmployeeDAO.java

package com.ram.employee.dao;

public interface EmployeeDAO
{
    public int updateEmployeeNameBasedOnAge(String name, int age);
}

EmployeeDAOImpl.java

package com.ram.employee.dao.impl;

import org.springframework.jdbc.core.support.JdbcDaoSupport;

import com.ram.employee.dao.EmployeeDAO;

public class EmployeeDAOImpl extends JdbcDaoSupport implements EmployeeDAO
{

    public int updateEmployeeNameBasedOnAge(String name, int age)
    {
        String sql = "update Employee set Name=? where AGE=?";
        int numberOfRowsAffected = getJdbcTemplate().update(sql,
                new Object[] { name, age });
        return numberOfRowsAffected;
    }

}

applicationContext.xml

<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-4.3.xsd">


    <bean id="dataSource"
        class="org.springframework.jdbc.datasource.DriverManagerDataSource">
        <property name="driverClassName" value="com.mysql.jdbc.Driver" />
        <property name="url" value="jdbc:mysql://localhost:3306/org_db" />
        <property name="username" value="root" />
        <property name="password" value="root" />
    </bean>

    <bean id="employeeDAO" class="com.ram.employee.dao.impl.EmployeeDAOImpl">
        <property name="dataSource" ref="dataSource" />
    </bean>
   
</beans>

App.java

package com.ram.core;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import com.ram.employee.dao.EmployeeDAO;

public class App
{
    public static void main(String[] args)
    {
        ApplicationContext context = new ClassPathXmlApplicationContext(
                "applicationContext.xml");

        EmployeeDAO employeeDAO = (EmployeeDAO) context.getBean("employeeDAO");
        int numberOfRowsAffected = employeeDAO
                .updateEmployeeNameBasedOnAge("Juli", 28);
        System.out.println("numberOfRowsAffected = " + numberOfRowsAffected);
        System.out.println("Employee name updated successfully.");
    }
}

Output:

Feb 14, 2019 10:42:47 AM org.springframework.context.support.AbstractApplicationContext prepareRefresh
INFO: Refreshing org.springframework.context.support.ClassPathXmlApplicationContext@35d176f7: startup date [Thu Feb 14 10:42:47 IST 2019]; root of context hierarchy
Feb 14, 2019 10:42:47 AM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
INFO: Loading XML bean definitions from class path resource [applicationContext.xml]
Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver class is `com.mysql.cj.jdbc.Driver'. The driver is automatically registered via the SPI and manual loading of the driver class is generally unnecessary.
Feb 14, 2019 10:42:48 AM org.springframework.jdbc.datasource.DriverManagerDataSource setDriverClassName
INFO: Loaded JDBC driver: com.mysql.jdbc.Driver
Thu Feb 14 10:42:57 IST 2019 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.
numberOfRowsAffected = 1
Employee name updated successfully.

Click the below link to download the code:
https://sites.google.com/site/javaspringram2019/java_spring_2019/SpringDemo_update_object_array.zip?attredirects=0&d=1

Github Link:
https://github.com/ramram43210/Java_Spring_2019/tree/master/Spring_2019/SpringDemo_update_object_array

Bitbucket Link:
https://bitbucket.org/ramram43210/java_spring_2019/src/8f8b5563b7f2921ed260908e4906103995d9c6cc/Spring_2019/SpringDemo_update_object_array/?at=master

See also:

  • All JavaEE Videos Playlist
  • All JavaEE Videos
  • All JAVA EE Links
  • Spring Tutorial
  • Servlets Tutorial
  • All Design Patterns Links
  • JDBC Tutorial
  • Java Collection Framework Tutorial
  • JAVA Tutorial
  • Kids Tutorial
  • Cooking Tutorial
  • Spring + JdbcTemplate + Update the rows with multiple parameters with object args example

    🚀 Master Spring JDBC Today!

    Don't miss out on more Java tutorials. Join the Ram N Java family now!

    SUBSCRIBE TO OUR CHANNEL

    Updating Database Rows with Multiple Parameters

    In modern Java development, updating database records with multiple conditions is a very common task. Using Spring JdbcTemplate, you can perform these updates cleanly by passing arguments as an Object array.

    The SQL Query with Placeholders

    When updating data based on multiple filters (like updating a name where the ID and age match), we use question marks (?) as placeholders in our SQL string:

    UPDATE employee SET name = ? WHERE age = ? AND id = ?

    Why Use Object Arguments?

    Passing an array of objects to the update method is a beginner-friendly approach for several reasons:

    • Simplicity: You don't need to manually concatenate strings, which prevents SQL injection.
    • Organization: It keeps your Java code tidy even when dealing with many parameters.
    • Automatic Mapping: Spring automatically maps the objects in your array to the ? placeholders in order.

    Step-by-Step Logic

    1. Prepare your SQL: Write your update statement using ? for values.
    2. Create an Object Array: Define new Object[] { "New Name", 25, 101 }.
    3. Execute Update: Use jdbcTemplate.update(sql, objectArray) to apply the changes.

    More Recommended Tutorials

    Keep learning with these related videos from our channel:


    Click here to watch on Youtube:
    https://www.youtube.com/watch?reload=9&v=T1smXPUZzuA&list=UUhwKlOVR041tngjerWxVccw

    Click the below Image to Enlarge:

    Spring + JdbcTemplate + Update the rows with multiple parameters with object args example
    Employee.sql

    CREATE DATABASE org_db;


    CREATE TABLE `employee` (
      `EMPLOYEE_ID` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
      `NAME` VARCHAR(100) NOT NULL,
      `AGE` INT(10) NOT NULL,
      `SALARY` INT(10) DEFAULT NULL,
      PRIMARY KEY (`EMPLOYEE_ID`)
    ) ENGINE=INNODB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;


    INSERT INTO `employee` (`EMPLOYEE_ID`, `NAME`, `AGE`, `SALARY`) VALUES('1','Peter','28','80000');
    INSERT INTO `employee` (`EMPLOYEE_ID`, `NAME`, `AGE`, `SALARY`) VALUES('2','John','50','40000');
    INSERT INTO `employee` (`EMPLOYEE_ID`, `NAME`, `AGE`, `SALARY`) VALUES('3','David','45','20000');

    pom.xml

    <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
        <modelVersion>4.0.0</modelVersion>
        <groupId>com.ram.core</groupId>
        <artifactId>SpringDemo</artifactId>
        <packaging>jar</packaging>
        <version>1.0-SNAPSHOT</version>
        <name>SpringDemo</name>
        <url>http://maven.apache.org</url>

        <properties>
            <spring.version>5.0.5.RELEASE</spring.version>
        </properties>

        <dependencies>
            <dependency>
                <groupId>junit</groupId>
                <artifactId>junit</artifactId>
                <version>3.8.1</version>
                <scope>test</scope>
            </dependency>

            <!-- Spring 5 dependencies -->
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-core</artifactId>
                <version>${spring.version}</version>
            </dependency>

            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-context</artifactId>
                <version>${spring.version}</version>
            </dependency>

            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-jdbc</artifactId>
                <version>${spring.version}</version>
            </dependency>

            <!-- MySQL database driver -->
            <dependency>
                <groupId>mysql</groupId>
                <artifactId>mysql-connector-java</artifactId>
                <version>8.0.11</version>
            </dependency>

        </dependencies>

    </project>

    EmployeeDAO.java

    package com.ram.employee.dao;

    public interface EmployeeDAO
    {
        public int updateEmployeeNameBasedOnAge(String name, int age);
    }

    EmployeeDAOImpl.java

    package com.ram.employee.dao.impl;

    import org.springframework.jdbc.core.support.JdbcDaoSupport;

    import com.ram.employee.dao.EmployeeDAO;

    public class EmployeeDAOImpl
            extends JdbcDaoSupport implements EmployeeDAO
    {

        public int updateEmployeeNameBasedOnAge(String name, int age)
        {
            String sql = "update Employee set Name=? where AGE=?";
            int numberOfRowsAffected = getJdbcTemplate().update(sql, name, age);
            return numberOfRowsAffected;
        }

    }

    applicationContext.xml

    <beans xmlns="http://www.springframework.org/schema/beans"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://www.springframework.org/schema/beans
    http://www.springframework.org/schema/beans/spring-beans-4.3.xsd">


        <bean id="dataSource"
            class="org.springframework.jdbc.datasource.DriverManagerDataSource">
            <property name="driverClassName" value="com.mysql.jdbc.Driver" />
            <property name="url" value="jdbc:mysql://localhost:3306/org_db" />
            <property name="username" value="root" />
            <property name="password" value="root" />
        </bean>

        <bean id="employeeDAO" class="com.ram.employee.dao.impl.EmployeeDAOImpl">
            <property name="dataSource" ref="dataSource" />
        </bean>
       
    </beans>

    App.java

    package com.ram.core;

    import org.springframework.context.ApplicationContext;
    import org.springframework.context.support.ClassPathXmlApplicationContext;

    import com.ram.employee.dao.EmployeeDAO;

    public class App
    {
        public static void main(String[] args)
        {
            ApplicationContext context = new ClassPathXmlApplicationContext(
                    "applicationContext.xml");

            EmployeeDAO employeeDAO = (EmployeeDAO) context
                    .getBean("employeeDAO");
            int numberOfRowsAffected = employeeDAO.updateEmployeeNameBasedOnAge("Juli",28);
            System.out.println("numberOfRowsAffected = "+ numberOfRowsAffected);
            System.out.println("Employee name updated successfully.");
        }
    }

    Output:

    Feb 13, 2019 10:19:14 AM org.springframework.context.support.AbstractApplicationContext prepareRefresh
    INFO: Refreshing org.springframework.context.support.ClassPathXmlApplicationContext@35d176f7: startup date [Wed Feb 13 10:19:14 IST 2019]; root of context hierarchy
    Feb 13, 2019 10:19:15 AM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
    INFO: Loading XML bean definitions from class path resource [applicationContext.xml]
    Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver class is `com.mysql.cj.jdbc.Driver'. The driver is automatically registered via the SPI and manual loading of the driver class is generally unnecessary.
    Feb 13, 2019 10:19:16 AM org.springframework.jdbc.datasource.DriverManagerDataSource setDriverClassName
    INFO: Loaded JDBC driver: com.mysql.jdbc.Driver
    Wed Feb 13 10:19:29 IST 2019 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.
    numberOfRowsAffected = 1
    Employee name updated successfully.

    Click the below link to download the code:
    https://sites.google.com/site/javaspringram2019/java_spring_2019/SpringDemo_update_args.zip?attredirects=0&d=1

    Github Link:
    https://github.com/ramram43210/Java_Spring_2019/tree/master/Spring_2019/SpringDemo_update_args

    Bitbucket Link:
    https://bitbucket.org/ramram43210/java_spring_2019/src/8f8b5563b7f2921ed260908e4906103995d9c6cc/Spring_2019/SpringDemo_update_args/?at=master

    See also:

  • All JavaEE Videos Playlist
  • All JavaEE Videos
  • All JAVA EE Links
  • Spring Tutorial
  • Servlets Tutorial
  • All Design Patterns Links
  • JDBC Tutorial
  • Java Collection Framework Tutorial
  • JAVA Tutorial
  • Kids Tutorial
  • Cooking Tutorial
  • Thursday, 21 February 2019

    Spring + JdbcTemplate + Execute delete statement with multiple parameters with object array example

    🚀 Master Java & Spring!

    Get the best coding tutorials simplified for you. Join the Ram N Java community today!

    SUBSCRIBE NOW

    Deleting Rows with Multiple Parameters in Spring JDBC

    Deleting specific records from a database is a core operation in any application. While deleting by a single ID is common, sometimes you need to delete based on multiple conditions (e.g., delete an employee with a specific name AND age). In this guide, we'll see how Spring JdbcTemplate makes this easy using Object Arrays.

    The SQL Delete Logic

    To delete with multiple conditions, we use ? placeholders in our SQL string. This keeps the code clean and protects against SQL injection:

    DELETE FROM employee WHERE name = ? AND age = ?

    Using the Object Array Approach

    Spring's update() method (used for INSERT, UPDATE, and DELETE) can take an array of objects as an argument. This is perfect for beginners because:

    • Easy Mapping: The first object in the array replaces the first ?, the second replaces the second ?, and so on.
    • Type Safety: You can mix different types (Strings, Integers, etc.) in the same array.
    • Readable Code: It separates your SQL query from your actual data values.

    How to Implement It

    1. SQL String: Define your query with DELETE FROM ... WHERE ... ? AND ... ?.

    2. Object Array: Create your data array: new Object[] { "John Doe", 30 }.

    3. Execution: Call jdbcTemplate.update(sql, objectArray).

    ⚡ Quick Tip:

    Always check the return value of the update() method. It returns an int representing the number of rows actually deleted!

    Check Out More Tutorials

    Explore these related videos from Ram N Java to build your Spring JDBC expertise:


    Click here to watch on Youtube: 
    https://www.youtube.com/watch?v=J4uwf_2l2PQ&list=UUhwKlOVR041tngjerWxVccw

    Click the below Image to Enlarge:
    Spring + JdbcTemplate + Execute delete statement with multiple parameters with object array example

    Employee.sql

    CREATE DATABASE org_db;


    CREATE TABLE `employee` (
      `EMPLOYEE_ID` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
      `NAME` VARCHAR(100) NOT NULL,
      `AGE` INT(10) NOT NULL,
      `SALARY` INT(10) DEFAULT NULL,
      PRIMARY KEY (`EMPLOYEE_ID`)
    ) ENGINE=INNODB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;


    INSERT INTO `employee` (`EMPLOYEE_ID`, `NAME`, `AGE`, `SALARY`) VALUES('1','Peter','28','80000');
    INSERT INTO `employee` (`EMPLOYEE_ID`, `NAME`, `AGE`, `SALARY`) VALUES('2','John','50','40000');
    INSERT INTO `employee` (`EMPLOYEE_ID`, `NAME`, `AGE`, `SALARY`) VALUES('3','David','45','20000');

    pom.xml

    <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
        <modelVersion>4.0.0</modelVersion>
        <groupId>com.ram.core</groupId>
        <artifactId>SpringDemo</artifactId>
        <packaging>jar</packaging>
        <version>1.0-SNAPSHOT</version>
        <name>SpringDemo</name>
        <url>http://maven.apache.org</url>

        <properties>
            <spring.version>5.0.5.RELEASE</spring.version>
        </properties>

        <dependencies>
            <dependency>
                <groupId>junit</groupId>
                <artifactId>junit</artifactId>
                <version>3.8.1</version>
                <scope>test</scope>
            </dependency>

            <!-- Spring 5 dependencies -->
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-core</artifactId>
                <version>${spring.version}</version>
            </dependency>

            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-context</artifactId>
                <version>${spring.version}</version>
            </dependency>

            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-jdbc</artifactId>
                <version>${spring.version}</version>
            </dependency>

            <!-- MySQL database driver -->
            <dependency>
                <groupId>mysql</groupId>
                <artifactId>mysql-connector-java</artifactId>
                <version>8.0.11</version>
            </dependency>

        </dependencies>

    </project>

    EmployeeDAO.java

    package com.ram.employee.dao;

    public interface EmployeeDAO
    {
        public int deleteByEmployeeNameAndAge(String name,int age);
    }

    EmployeeDAOImpl.java

    package com.ram.employee.dao.impl;

    import org.springframework.jdbc.core.support.JdbcDaoSupport;

    import com.ram.employee.dao.EmployeeDAO;

    public class EmployeeDAOImpl extends JdbcDaoSupport implements EmployeeDAO
    {

        public int deleteByEmployeeNameAndAge(String name, int age)
        {
            String sql = "DELETE FROM EMPLOYEE WHERE Name=? and AGE=?";
            int numberOfRowsAffected = getJdbcTemplate().update(sql,
                    new Object[] { name, age });
            return numberOfRowsAffected;
        }

    }
    applicationContext.xml

    <beans xmlns="http://www.springframework.org/schema/beans"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://www.springframework.org/schema/beans
    http://www.springframework.org/schema/beans/spring-beans-4.3.xsd">


        <bean id="dataSource"
            class="org.springframework.jdbc.datasource.DriverManagerDataSource">
            <property name="driverClassName" value="com.mysql.jdbc.Driver" />
            <property name="url" value="jdbc:mysql://localhost:3306/org_db" />
            <property name="username" value="root" />
            <property name="password" value="root" />
        </bean>

        <bean id="employeeDAO" class="com.ram.employee.dao.impl.EmployeeDAOImpl">
            <property name="dataSource" ref="dataSource" />
        </bean>

    </beans>

    App.java

    package com.ram.core;

    import org.springframework.context.ApplicationContext;
    import org.springframework.context.support.ClassPathXmlApplicationContext;

    import com.ram.employee.dao.EmployeeDAO;

    public class App
    {
        public static void main(String[] args)
        {
            ApplicationContext context = new ClassPathXmlApplicationContext(
                    "applicationContext.xml");

            EmployeeDAO employeeDAO = (EmployeeDAO) context
                    .getBean("employeeDAO");
            int numberOfRowsAffected = employeeDAO.deleteByEmployeeNameAndAge("John",50);
            System.out.println(numberOfRowsAffected + " employee row deleted successfully.");
        }
    }

    Output:

    Feb 11, 2019 10:51:56 AM org.springframework.context.support.AbstractApplicationContext prepareRefresh
    INFO: Refreshing org.springframework.context.support.ClassPathXmlApplicationContext@35d176f7: startup date [Mon Feb 11 10:51:56 IST 2019]; root of context hierarchy
    Feb 11, 2019 10:51:56 AM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
    INFO: Loading XML bean definitions from class path resource [applicationContext.xml]
    Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver class is `com.mysql.cj.jdbc.Driver'. The driver is automatically registered via the SPI and manual loading of the driver class is generally unnecessary.
    Feb 11, 2019 10:51:57 AM org.springframework.jdbc.datasource.DriverManagerDataSource setDriverClassName
    INFO: Loaded JDBC driver: com.mysql.jdbc.Driver
    Mon Feb 11 10:52:06 IST 2019 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.
    1 employee row deleted successfully.

    Click the below link to download the code:
    https://sites.google.com/site/javaspringram2019/java_spring_2019/SpringDemo_delete_multi_param_object_array.zip?attredirects=0&d=1

    Github Link:
    https://github.com/ramram43210/Java_Spring_2019/tree/master/Spring_2019/SpringDemo_delete_multi_param_object_array

    Bitbucket Link:
    https://bitbucket.org/ramram43210/java_spring_2019/src/8f8b5563b7f2921ed260908e4906103995d9c6cc/Spring_2019/SpringDemo_delete_multi_param_object_array/?at=master

    See also:

  • All JavaEE Videos Playlist
  • All JavaEE Videos
  • All JAVA EE Links
  • Spring Tutorial
  • Servlets Tutorial
  • All Design Patterns Links
  • JDBC Tutorial
  • Java Collection Framework Tutorial
  • JAVA Tutorial
  • Kids Tutorial
  • Cooking Tutorial
  • Tutorials