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

  • Home
  • SEARCH
  • 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 7172885
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T15:42:31+00:00 2026-05-28T15:42:31+00:00

I have these table in my notepad and accessing the notepad from my Java

  • 0

I have these table in my notepad and accessing the notepad from my Java (GWT)
I want the fields parent code and teacher name from table Interviews: I am getting the parentcode Correctly but the problem is that TeacherName is not present in Interviews Table, I have to get teacher name from Teacher’s Table , How can i do JOIN ?

Thanks

     ##Teachers
     #teacherId     teacherCode       teacherName         roomCode  
     56750              AC         Langton, Wylie          4CJKH    
     56751              AF         Nestler, Shannae        FTEJH    
     56752              AH         O'connell, Shannae      Q7STH

     ##Interviews
     #parentCode             studentKey yearLevel         teacherCode
     parentof.400052328     400052328      8                    AH              
     parentof.400052328     400052328      8                    KR      
     parentof.400052328     400052328      8                    NAt 

Code to get values from the above table

     public ArrayList<Interviews> getParent() throws  Exception{

             ArrayList<Interviews> interviewList = new ArrayList<Interviews>();

             int interviewStartLine = 9753 ;
             int interviewEndLine =   9794 ;


                  try {
            FileInputStream fstream = new FileInputStream("c:/work/data1.txt");
            DataInputStream in = new DataInputStream(fstream);
            BufferedReader br = new BufferedReader(new InputStreamReader(in));
            String strLine ="";
              int j =0;
            for(int i = 0 ; i<interviewStartLine ; i++){

                j++;
                br.readLine();
                if(j==9753){
                    for(int line = j ; line<interviewEndLine ; line++){

                        strLine = br.readLine().trim();
                        if ((strLine.length()!=0) && (strLine.charAt(0)!='#')) {
                            String[] teachers = strLine.split("\\s+");
                            System.out.println(strLine);
                            Interviews interview = new Interviews();
                            interview.setParentCode(teachers[3]);
                            interview.setTime(teachers[5]);
                            interviewList.add(interview);


                        }}}


        }
            in.close();
        } catch (Exception e) {// Catch exception if any
            System.err.println("Error: " + e.getMessage());
        }

        return interviewList;
    }

Interview Class:

        private String parentCode;
 private String time;
 private Students studentName;
 private Teachers teacherName;


public String getParentCode() {
    return parentCode;
}

public void setParentCode(String parentCode) {
    this.parentCode = parentCode;
}

public String getTime() {
    return time;
}

public void setTime(String time) {
    this.time = time;
}
  • 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-28T15:42:32+00:00Added an answer on May 28, 2026 at 3:42 pm

    I think the proper way is to read the file, extract the structures and then manipulate them. For example, design a Teacher Class containing the teacher parameters:

    class Teacher {
    
        private int ID;
        private String Code;
        private String Name;
    
    // Constructor + accessors ...
    
    }
    

    The same goes for Interview which is a class containing a reference to a Teacher

    class Interview {
    
        private int studentKey;
        private int yearLevel;
        private Teacher teacher;
    
        // Constructor + accessors ...
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Suppose you have these tables: Table Name: Salesman Fields: S_ID(Primary Key), Name Table Name:
I have a database table (named Topics) which includes these fields : topicId name
I have a table that have these fields: ID , Name I have bound
I have these tables CREATE TABLE parent ( id NUMBER(10, 0) NOT NULL, name
Hi every one I have these classe @Entity @Table(name = login, uniqueConstraints={@UniqueConstraint(columnNames={username_fk})}) public class
I have an SQL Server DB with a table with these fields: A bit
I have a table that contains tasks and I want to give these an
I have these information : Table Users => **Id** **Name** 1 a 2 b
I have these two class(table) @Entity @Table(name = course) public class Course { @Id
In my table (MySQL) I have these fields: id - primary, auto_increment hash -

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.