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 8401841
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T21:54:30+00:00 2026-06-09T21:54:30+00:00

I need to use the following query. SELECT m.member_id, cardflag FROM member m, member_attribute

  • 0

I need to use the following query.

SELECT m.member_id, cardflag FROM member m, member_attribute ma WHERE m.member_number=:memberNumber AND m.ref_club_status IN ('A','S') AND m.member_id=ma.member_id

The datatype of member_id is byte array, and that of cardflag is varchar.

I need to use this query in my code, and looking at the options in jdbctemplate documentation, queryForList seems to be the best choice. I have been trying, but couldnt make out much as to how to pass the parameter to my query and also as to how to handle the return type.

Can anyone please help?

Thanks a lot in advance.

  • 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-09T21:54:31+00:00Added an answer on June 9, 2026 at 9:54 pm

    My answer is

    String sql = "SELECT m.member_id, searscc FROM member m, member_attribute ma " +
                "WHERE m.member_number=:memberNumber AND m.ref_club_status IN ('A','S') AND m.member_id=ma.member_id";
    String memberNumber = "John Doe";                   //the argument value for the sql above
    JdbcTemplate jdbcTemplate = new JdbcTemplate();     //replace this line with your own code to get JdbcTemplate instance.
    List<Map<String, Object>> rows = jdbcTemplate.queryForList(sql, new Object[]{memberNumber}) ;
    byte[] tempMemberIds = null;
    String tempSearscc = null;
    if ((rows != null) || (rows.size() > 0)) {
        for (Map<String, Object> tempRow : rows) {
            tempMemberIds = (byte[])(tempRow.get("member_id"));     //key is your search field in your sql
            tempSearscc = (String)(tempRow.get("searscc"));
            //do your own jobs
        }
    } else {
        //do something else
    }
    

    Hope this useful.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to fix following query: SELECT * FROM message_treads LEFT JOIN usernames ON
i have the following sql query select * from tblArea where AreaDescription in ('Processing1','Geology
I have the following query: SELECT `people`.`surename`, calcWeight(`people`.`surname`,'kiera',6) as `weight` FROM `people` LEFT JOIN
I have the following query SELECT ID, TestReason FROM Test as t INNER JOIN
I have following complex query which I need to use. When I run it,
I have the following query: SELECT * from foo where timestamp = (select max(timestamp)
I have following query select * from table1 if table1 contains text type column/columns
I have the following query SELECT P.ID, MAX(ENTERDATE) as ENTERDATE, MAX(B.CostID) as CostID FROM
I need to run following query: SELECT m.TITLE, m.MOMENTOIMAGE, s.CREATED_AT, s.UNREAD, mem.FIRSTNAME, mem.LASTNAME, mem.MEMBER_PHOTO,
I have the following query SELECT interview_content.title `title`, gallery_images.img_path img FROM `interview`, `interview_content`, `gallery`,

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.