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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T04:31:41+00:00 2026-05-27T04:31:41+00:00

I am working on a stand-alone Java project (not Java EE), I am currently

  • 0

I am working on a stand-alone Java project (not Java EE), I am currently learning JDBC, I am creating a database where it contains Employee information, such as Personal information, Contact Information, Employee Information and Tax information, all of these are classes with references with each other and they have setters and getters, I am wondering how would I insert their data value in the database/tables I created in the database? in short I have Employee an employee object with like this

Employee(PersonalInformation information,ContactInformation cInformation)

Something like that, how would I add their data in the tables I made in the database?

  • 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-05-27T04:31:42+00:00Added an answer on May 27, 2026 at 4:31 am

    how would I add their data in the tables I made in the database?

    By using JDBC to send INSERT statements to the database, one for each object in your object graph (assuming you have one table per class).

    And yes, that’s a lot of boring, repetitive code to write, which is likely to contain errors and quite a burden to maintain.

    Which is why people have written Object-Relational mappers like Hibernate, and there’s a Java standard for that called JPA. Which is part of Java EE, but that doesn’t mean you have to run a Java EE server to use it.

    Update: OK, so you cannot use an ORM, probably because you’re supposed to understand how JDBC works first, which makes sense because ORMs are based on JDBC and sometimes you have to go down to that level when there is a problem.

    When using JDBC directly, you typically create a DAO (data ccess object) layer that is responsible for writing and reading objects to/from the database. For dealing with a nested object, one DAO can call the other.

    And no, the DAOs are not called in the setters and getters. There called by the part of your application that reacts to user input. E.g. when the user opens the application and the start screen shows a list of employees, you’d call an EmployeeDAO.findAll() method, and when the user makes changes to an employee and clicks on “save”, you’d call the EmployeeDAO.save() method.

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

Sidebar

Related Questions

We are currently working on a project with both actionscript and Java. Up to
I am working with jetty hightide vesion 7 currently as a stand alone server.
I'm working on a Firefox extension that will manipulate highlighted text. On a stand-alone
i have the following situation, i have a Reporting layer(stand alone) in asp.net application(NOT
Environnement : Simple Java stand-alone application. AspectJ jar inside. I've two projects. The first
Im working on a java project where i need to read some objects from
I tried working Ftp download stand alone application and it works fine. But when
I am working in a Java EE project that integrates with SAP system, and
I am currently working on an academic project which employs an ASTVisitor to create
I am not working on an Eclipse plug-in project; however, I use an external

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.