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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T06:44:31+00:00 2026-06-09T06:44:31+00:00

I have three database tables defined below, column names mentioned in parenthesis: Product (ProductID,

  • 0

I have three database tables defined below, column names mentioned in parenthesis:

Product (ProductID, Price, Last_Updated)

User (UserID, Name, Address, LocationID, Last_Updated)

Location (LocationID, Loc_Name, Last_Updated)

I want to use Java (JDK 1.5) to add all the column names of all the tables in one collection like a HashMap.

My problem is when a duplicate key is entered, the previous value is over ridden.

I am adding them like:

Map<String, String> map = new HashMap<String, String>();

map.add("ProductID", "Save the Product ID");
// ...
map.add("Last_Updated", "Save Last_Updated of Product table");
// ...
map.add("LocationID", "Save the LocationID");
// ...
map.add("Last_Updated", "Save Last_Updated of User table.");

Now the key Last_Updated is overridden with new value Save Last_Updated of User table.

But I want both the values.

Is there any way to implement this without using multiple HashMap structures?

  • 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-09T06:44:33+00:00Added an answer on June 9, 2026 at 6:44 am

    Add the table names as a prefix to your column names. Then you can separate “Product.Last_Updated”, “User.Last_Updated” and “Location.Last_Updated”.
    Obviously you have to use a separator char that is not used in the names of your tables or columns; a ‘.’ should do.

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

Sidebar

Related Questions

I have defined models based on the tables in the database. Now there are
I have three database tables: users emails invitations Emails are linked to users by
I have three tables in a Mysql database - countries, cities and hotels. Their
In my database I have three tables: Users: UserID (Auto Numbering), UserName, UserPassword and
I have three or four tables in a MySQL database associated with an upcoming
I have three mysql table from same database Db1. Three tables have following columns.
I have a database with three tables: user_table country_table city_table I want to write
I have a database with three tables in my database namely catering, room, room_booking
I have three tables in my database. News, reviews and tutorials. I would like
Hi have the following tables defined in my database: Transactions: - TransactionID (PK, Identity)

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.