Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9154929
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T12:30:32+00:00 2026-06-17T12:30:32+00:00

Experimenting with Spring-JDBC. I am using this as reference. I am trying to get

  • 0

Experimenting with Spring-JDBC. I am using this as reference. I am trying to get a list of actors who have the same last name. Running this code gave me the desired results:

public List<String> getActorsWithSameLastName(String lastName,
            NamedParameterJdbcTemplate template) {
        String query = "SELECT FIRSTNAME FROM ACTORS WHERE LASTNAME=:LASTNAME";
        Map<String, String> paramMap = new HashMap<String, String>();
        paramMap.put("LASTNAME", lastName);
        return template.queryForList(query, paramMap, String.class);
    }

I have a List<String> of last names. How can I get a List of actors with the list that I have? Do I iterate over the list of last names and call the getActorsWithSameLastName() everytime or does spring provide a way where it does the iteration and fetches the result for me? Please advice.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T12:30:33+00:00Added an answer on June 17, 2026 at 12:30 pm

    Use IN Clause..

    How to use SELECT IN clause in JDBCTemplates?

    List<String> lastnames= new ArrayList<>();
    
    Map namedParameters = Collections.singletonMap("lastnamevalues", lastnames);
    
    StringBuffer recordQueryString = new StringBuffer();
    
    recordQueryString.append("select FIRSTNAME, LASTNAME from ACTORS where lastname in (:lastnamevalues)");
    
    List nameInvolvements = this.namedparameterJdbcTemplate.query(recordQueryString.toString(), namedParameters, new MyMapper());
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Im using Spring 3.0 and JDBC I'm currently experimenting with spring for a desktop
I have been experimenting with using Spring 3.1's bean definition profiles and nested beans.
I'm experimenting with Spring Mobile but I can't seem to get the basic example
Im currently reading Spring in Action 3rd edition, and have been experimenting with Spring
I am trying to create a dynamic proxy using Spring.NET and C# for a
Using OrmLite with android I have tried experimenting with a simple query: GenericRawResults<String[]> results
i have just begun experimenting on using table layout panel to keep things organised.
This week I've been trying to learn Spring, JBoss, Maven, JPA and Hibernate and
While experimenting with this question on collections in Spring.NET , I discovered that Spring
I have been experimenting with Process and ProcessBuilder and come with this SSCCE. import

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.