How to create query for tables with many to many relationship

in my sql i'm unable to update the table using select clause...is there any way to update a table which is in many to many relationship.
Ex:1st table student(student_id int primary key auto_increment, student_name varchar(30));
2nd table contact (contact_id int primary key auto_increment, c_email varchar(40));
3rd table student_contact(student_id int references student, contact_id int references contact);
i would like to auto insert the both two columns in the student_contact while the student and the contact table being updated automatically.

This is a JSP/JSTL forum, not a SQL forum. If you're using MySQL, better use their own forums at dev.mysql.com.
I'll give some hints anyway: learn about SQL JOIN. In general there is good SQL documentation available at the website of the RDBMS manfacturer. Go check it out. There is also a nice SQL tutorial at w3schools.com. Good luck.

Similar Messages

  • How to create variant for table/view ?

    Hi,
    When I go through SM30, I find a radio button called variant. I don't know the effect.
    Can anyone tell me how to create variant for table / view ?
    I want to know when we need to create variant for table/view.
    Best regards,
    Chris Gu

    hi ,
    Whenever you start a program in which selection screens are defined, the system displays a set of input fields for database-specific and program-specific selections. To select a certain set of data, you enter an appropriate range of values.
    For further information about selection screens, refer to Selection Screens in the ABAP User's Guide.
    If you often run the same program with the same set of selections (for example, to create a monthly statistical report), you can save the values in a selection set called a variant
    Procedure
    To create a new variant:
           1.      On the ABAP Editor initial screen, enter the name of the program for which you want to create a variant, select Variants, and choose Change.
           2.      On the variant maintenance initial screen, enter the name of the variant to be created.
    Note the naming convention for variants (see below).
           3.      Choose Create.
    If the program has more than one selection screen, a dialog box for screen assignment appears. The dialog box does not appear if the program only has one selection screen. The selection screen appears in this case.
           4.      If there is more than one selection screen, select the screens for which you want to create the variant
    5.      Choose Continue.
    The (first) selection screen for the report appears.
    If your program has more than one selection screen, use the scroll buttons in the left-hand corner of the application toolbar to navigate between them and to fill the fields with values. If you keep scrolling forwards, the Continue button appears on the last selection screen.
           6.      Enter the desired selection values, including multiple selection and dynamic selection.
           7.      Choose Continue.

  • How to create database and table with GUI?

    How to create database and table with GUI?
    for linux can do that?
    or have only way to create table by use sql*plus.
    everyone please help me.
    thanks

    go to www.orasoft.org
    here is a gui tool.
    null

  • How to Create a Temporary Table with SQL Server

    I know you can create a temporary table in SQL Server 2000, but not quite sure how to do it in CFMX 7, i.e., does the SQL go inside a <CFQUERY dbtype="query"> tag?
    I'm pulling the main set of records from an Oracle server (1st data source), but it does not contain employee names, only employee IDs.  Since I need to show the employee name along with the Emp ID, I'm then pulling a list of "current" employee names from a SQL Server (2nd data source), which is the main database on our CF server.
    I've got a QofQ that works fine, except it only matches EmpIDs that exist in both result sets.  Employees who are no longer employed, don't match, and don't display.  Since I can't do a LEFT OUTER JOIN with a QofQ, what I need to do is get the records from the Oracle server into the SQL Server.  Preferably in a temporary table.
    I was hoping if I could get those Oracle records written to a temp table on the main SQL Server, in same database as the Employee Name table, I could then write a normal <CFQUERY> that uses a LEFT OUTER JOIN.
    I think I could probably write a Stored Procedure that would execute the SQL to create the temporary table, but am trying to avoid having to write the SP, and do it the simplest way.
    This query will be a program that can be run hundreds of times per day, with a form that allows users to select date ranges, locations, and other options.  That starts the queries, which creates the report.  So I just need the temp table to exist only until all the SQL has run, and the <CFOUTPUT> has generated a report.
    If the premise is right, I just need some help with the syntax for creating a SQL Server temp table, when you want to write records to it from an external data source.  I'm trying the following, but getting an error:
    <CFQUERY name="ITE_Temp" datasource="SkynetSQL">
    CREATE TABLE #MyTemp
    (   INSERT INTO #MyTemp
    ITE2.TrueFile char (7) NOT NULL,
    ITE2.CountOfEmployee int NULL,
    ITE2.DTL_SUBTOT decimal NULL,
    ITE2.EMPTYPE char (3) NULL,
    ITE2.ARPT_CD char (3) NULL
    </CFQUERY>
    So I actually created a permanent table on the SQL Server, and wrote the below SQL, which does work, and does write the records to table.  I can then write another CFQUERY with a LEFT OUTER JOIN, and get all the records, including those that don't have matching employee name:
    <CFQUERY datasource="SkynetSQL">
    <CFLOOP index="i" from="1" to = "#ITE2.RecordCount#">
    INSERT INTO ITE_Temp
       (FullFile,
       EmployeeCount,
       DTL_Amount,
       EmployeeType,
       station)
    VALUES  ('#ITE2.TrueFile[i]#',
       #ITE2.CountOfEmployee[i]#,
       #ITE2.DTL_SUBTOT[i]#,
       '#ITE2.EMPTYPE[i]#',
       '#ITE2.ARPT_CD[i]#')
    </CFLOOP>
    </CFQUERY>
    But, I hate to have to create a table and physically write to it.  For one, it seems slower, and doing it in temp would be in memory, and probably much faster, correct?  Is there some way to code the above, so that it does something similar, but in a TEMPORARY TABLE?   If I can figure out how to do this, I can pull data from multiple data sources and servers, and using SQL Server temp tables, work with the data as if it was all on the same SQL Server, and do some cool reports.
    Everything I've done for the past few years, has all been from data from a single source, whether SQL Server, or another server.  Now I need to start writing reports where data can come from 3 or 4 different servers, and be able to do joins (inner and outer).  Thanks for any advice/help.  Much appreciated.
    Gary

    While waiting to hear back, I was able to write the query results from an outside Oracle server, to a table on the local SQL Server, and do the LEFT OUTER JOIN required for the final query and report to work.  That was with this syntax:
    <CFQUERY name="AddTableRecords" datasource="MyTable">
    TRUNCATE TABLE ITE_Temp
    <CFOUTPUT query="ITE2">
    INSERT INTO ITE_Temp
    (FullFile,EmployeeCount,DTL_Amount,EmployeeType,station)
    VALUES
    ('#TrueFile#', #CountOfEmployee#, #DTL_SUBTOT#, '#EMPTYPE#', '#ARPT_CD#')
    </CFOUTPUT>
    </CFQUERY>
    However, I was not able to write to a temporary table AND read the results. I got the syntax to run to write the above results to a temporary table.  But when I tried to read and output the results from the temp table, I got an error.  Also, it wouldn't take the single "#" (local) only the global "##" table var, using this syntax.  Note that if I didn't have the DROP TABLE in the beginning, the 2nd time you run this query, you get an error telling you the table already exists.
    <CFQUERY name="ITE_Temp2" datasource="MyTable">
    DROP TABLE ##MyTemp2
    CREATE TABLE ##MyTemp2
    FullFile char (7) NOT NULL,
    EmployeeCount int NULL,
    DTL_Amount decimal NULL,
    EmployeeType char (3) NULL,
    station char (3) NULL
    <CFOUTPUT query="ITE2">
    INSERT INTO ##MyTemp2 VALUES
    '#ITE2.TrueFile#',
    #ITE2.CountOfEmployee#,
    #ITE2.DTL_SUBTOT#,
    '#ITE2.EMPTYPE#',
    '#ITE2.ARPT_CD#'
    </CFOUTPUT>
    </CFQUERY>
    So even though the above works, I could use some help in reading/writing the output.  I've tried several things similar to below, but they don't work.  It't telling me ITE_Temp2 does not exist.  It's not easy to find good examples of creating temporary tables in SQL Server.
    <CFQUERY name="QueryTest2" datasource="SkynetSQL">
    SELECT *
    FROM ITE_Temp2
    </CFQUERY>
    <CFOUTPUT query="ITE_Temp2">
    Output from Temp Table<br>
    <p>FullFile: #FullFile#, EmployeeCount: #EmployeeCount#</p>
    </CFOUTPUT>
    Thanks for any help/advice.
    Gary.

  • How to create a cutoms table with a heading

    Dear Freinds,
    I have a requirement where i have to create the Custom as below .........my functional is
    saying that he want table as below
                                              outpatient  
    employeeno
    class
    startdate
    enddate
    spouse
    1stchild
    2nchild
    How can we create like this table having outpatient  as heading
    and a fields  as
    employeeno , class,startdate,enddate,spouse,1stchild,2ndchild
    how can we create in a custom table..... i have never seenlike the above requiremnt.
    Please suggest me how to create. I can send the Excel sheet where they have given the above requiremnt...... plelase any body can suggest me so that i can your personnel id's . Pleast a bit urgent.
    regards
    syamala

    While waiting to hear back, I was able to write the query results from an outside Oracle server, to a table on the local SQL Server, and do the LEFT OUTER JOIN required for the final query and report to work.  That was with this syntax:
    <CFQUERY name="AddTableRecords" datasource="MyTable">
    TRUNCATE TABLE ITE_Temp
    <CFOUTPUT query="ITE2">
    INSERT INTO ITE_Temp
    (FullFile,EmployeeCount,DTL_Amount,EmployeeType,station)
    VALUES
    ('#TrueFile#', #CountOfEmployee#, #DTL_SUBTOT#, '#EMPTYPE#', '#ARPT_CD#')
    </CFOUTPUT>
    </CFQUERY>
    However, I was not able to write to a temporary table AND read the results. I got the syntax to run to write the above results to a temporary table.  But when I tried to read and output the results from the temp table, I got an error.  Also, it wouldn't take the single "#" (local) only the global "##" table var, using this syntax.  Note that if I didn't have the DROP TABLE in the beginning, the 2nd time you run this query, you get an error telling you the table already exists.
    <CFQUERY name="ITE_Temp2" datasource="MyTable">
    DROP TABLE ##MyTemp2
    CREATE TABLE ##MyTemp2
    FullFile char (7) NOT NULL,
    EmployeeCount int NULL,
    DTL_Amount decimal NULL,
    EmployeeType char (3) NULL,
    station char (3) NULL
    <CFOUTPUT query="ITE2">
    INSERT INTO ##MyTemp2 VALUES
    '#ITE2.TrueFile#',
    #ITE2.CountOfEmployee#,
    #ITE2.DTL_SUBTOT#,
    '#ITE2.EMPTYPE#',
    '#ITE2.ARPT_CD#'
    </CFOUTPUT>
    </CFQUERY>
    So even though the above works, I could use some help in reading/writing the output.  I've tried several things similar to below, but they don't work.  It't telling me ITE_Temp2 does not exist.  It's not easy to find good examples of creating temporary tables in SQL Server.
    <CFQUERY name="QueryTest2" datasource="SkynetSQL">
    SELECT *
    FROM ITE_Temp2
    </CFQUERY>
    <CFOUTPUT query="ITE_Temp2">
    Output from Temp Table<br>
    <p>FullFile: #FullFile#, EmployeeCount: #EmployeeCount#</p>
    </CFOUTPUT>
    Thanks for any help/advice.
    Gary.

  • How to create Dynamic internal table with columns also created dynamically.

    Hi All,
    Any info on how to create a dynamic internal table along with columns(fields) also to be created dynamically.
    My requirement is ..On the selection screen I enter the number of fields to be in the internal table which gets created dynamically.
    I had gone thru some posts on dynamic table creation,but could'nt find any on the dynamic field creation.
    Any suggestions pls?
    Thanks
    Nara

    I don't understand ...
    something like that ?
    *   Form P_MODIFY_HEADER.                                              *
    form p_modify_header.
      data : is_fieldcatalog type lvc_s_fcat ,
             v_count(2)      type n ,
             v_date          type d ,
             v_buff(30).
    * Update the fieldcatalog.
      loop at it_fieldcatalog into is_fieldcatalog.
        check is_fieldcatalog-fieldname+0(3) eq 'ABS' or
              is_fieldcatalog-fieldname+0(3) eq 'VAL' .
        move : is_fieldcatalog-fieldname+3(2) to v_count ,
               p_perb2+5(2)                   to v_date+4(2) ,
               p_perb2+0(4)                   to v_date+0(4) ,
               '01'                           to v_date+6(2) .
        v_count = v_count - 1.
        call function 'RE_ADD_MONTH_TO_DATE'
            exporting
              months        = v_count
              olddate       = v_date
            importing
              newdate       = v_date.
        if is_fieldcatalog-fieldname+0(3) eq 'ABS'.
          concatenate 'Quantité 0'
                      v_date+4(2)
                      v_date+0(4)
                      into v_buff.
        else.
          concatenate 'Montant 0'
                      v_date+4(2)
                      v_date+0(4)
                      into v_buff.
        endif.
        move : v_buff to is_fieldcatalog-scrtext_s ,
               v_buff to is_fieldcatalog-scrtext_m ,
               v_buff to is_fieldcatalog-scrtext_l ,
               v_buff to is_fieldcatalog-reptext .
        modify it_fieldcatalog from is_fieldcatalog.
      endloop.
    * Modify the fieldcatalog.
      call method obj_grid->set_frontend_fieldcatalog
           exporting it_fieldcatalog = it_fieldcatalog.
    * Refresh the display of the grid.
      call method obj_grid->refresh_table_display.
    endform.                     " P_MODIFY_HEADER

  • How to create an internal table with fields from different sources

    Hi.
    I need to create an internal table where some of the fields are from a database table, and the other fields are user specified. How do i do that?
    Example:
    DB table ZTAB with fields ZTAB-FIELD1, ZTAB-FIELD2.
    I want to create an internal table ITAB with the fields ZTAB-FIELD1, ZTAB-FIELD2 from ZTAB. In addition, I also want to have one more field RECORD_NO, which is not from ZTAB. How do I do it? Could I do something like below?
    DATA BEGIN OF ITAB.
            INCLUDE STRUCTURE ZTAB.
    DATA RECORD_NO TYPE I.
    DATA END OF UPLINE.
    Or, are there more efficient way of doing it? Thanks.

    hi KIan,
    go:
    general type
    TYPE : BEGIN OF ty_itab,
               field1 TYPE ztab-field1,
               field2 TYPE ztab-field2,
    *your own fields here:
               field TYPE i,
               field(30) TYPE c,
               END OF ty_itab.
    work area
    DATA : gw_itab TYPE ty_itab.
    internal table
    DATA : gt_itab TYPE TABLE OF ty_itab.
    hope this helps
    ec

  • How to create an internal table with a types structure?

    Hi experts,
    I've 3 internal tables with the same structure, I think I could put a type structure and put that type inside the body of the internal data, is this possible? If true, how can I put that?
    Example:
    TYPES: Begin of type_s,
                   pernr like pa0001-pernr,
                 end of type_s.
    Data: begin of itab_1 occurs 0,
    ¿¿¿??? reference to type_s
             end of itab_1.
    Thanks a lot,
    Regards,
    Rebeca

    Hi,
    Use like this..
    DATA: Begin of type_s,
    pernr like pa0001-pernr,
    end of type_s.
    DATA: BEGIN OF ITAB_1 OCCURS 0.
    INCLUDE STRUCTURE type_s.
    DATA: END OF ITAB_1.
    Otherwise like this.
    types: Begin of type_s,
    pernr like pa0001-pernr,
    end of type_s.
    Data: itab_1 type standard table of type_s.
    Note: You have to create work area explicitly.
    Like this
    data wa like itab1.
    Edited by: Velangini Showry Maria Kumar Bandanadham on May 26, 2009 1:04 PM

  • How to create transaction for table maintinance generator

    what is the procedure(steps) to create transaction for a table maintinance generator

    Hi,
    The link will be useful for ur requirement.
    allaboutsap.blogspot.com/2007/04/table-maintenance-in-sap-step-by-step.html
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/8129f164-0a01-0010-2a8e-8765287250fc
    REgards,
    Sarosh

  • How to create dynamic data tables with ADF 10g

    Hi,
    Can anyone provide sample code for creating dynamic data table in adf where column & row will be added dynamically according to the data coming from the Array List of data.
    I appreciate your help here.

    I think you've posted to the wrong forum. This one is for WebLogic Portal questions.
    Try the ADF/DVT forum:
    http://myforums.oracle.com/jive3/forum.jspa?forumID=1565

  • How to create a growing table  with hierarchical increasing of rows Eg. For each row there must be a subRow i can add like for 1 i can add 1.1

    i  can increase the row but how to make it hirarchical  so tha i can add rows under rows?

    You have the right link to get started on adding authentication to your Mobile service app. But for security reasons the MobileServiceUser class only exposes the authenticated UserId and MobileServiceAuthenticationToken properties. You can save these
    two values in your client application.
    Getting the user name and email address isn't available through this medium. You would have to call into the respective APIs for the service (Facebook or Twitter APIs).
    Abdulwahab Suleiman

  • How to create Mysql like table with LinkedList or LinkedHashMap

    Is it possible to create a class which can create tables like Mysql tables? Take the following table as an example,
    0, LastName0, FirstNam0, Ag0, Phon0
    1, LastName1, FirstNam1, Ag1, Phon1
    2, LastName2, FirstNam2, Ag2, Phon2
    It's very easy to create a table in MySql with the following data. Now what if I want to create a table in the memory, so I can retrieve or SORT it whichever way I want. I might want to sort it by lastname or by phone number.
    Is it possible to do that with LinkedList or LinkedHashMap?

    1. Create a class with the fields lastName, firstName, age, phone of appropriate types
    2. Create objects of this and put in some type of a collections (ArrayList, Vector)
    3. Sort it using Collections.sort. Use a Comparator that compares the fields of interest

  • How to create an internal table with header line in smartforms

    Hello Guys,
    I need to append the data in my internal table in smartforms by the problem is an error occurred "a table without header line  and therefore no component called tdline"
    i already declared the data under types declaration tab
    types : begin of ts_tline,
             TDFORMAT type tdformat,
             tdline type tdline,
            end of ts_tline.
    types : it_tline type table of ts_tline.
    and declare these in global data
    WA_TLINE type TS_TLINE
    XT_TLINE type IT_TLINE
    my syntax in program lines :
      LOOP AT  gy_lines INTO WA_PROJ.
        SPLIT wa_proj AT  cl_abap_char_utilities=>cr_lf
           INTO table IT_SPLIT.
        LOOP AT IT_SPLIT.
          MOVE it_split-commentext TO xt_TLINE-tdline.
    an error occured at this part ****
         append xt_TLINE.
        ENDLOOP.
      ENDLOOP.
    what is wrong with my code..it cannot append data to xt_tline.
    Please help.Will reward points
    Thanks in advance
    aVaDuDz

    check this link
    this will help u......
    http://www.****************/Tutorials/Smartforms/SFMain.htm
    reward IF..........
    regards
    Anbu

  • How to create a physical table with a session variable.

    Hello,
    I have been trying to accomplish accessing data multiple databases from a single rpd and single connection pool. Is there a way to do it using session variables and OBIEE stored procedures or something. If someone has anything I could read up(unless I have already googled it), it would really help me out.
    Thanks.

    Where is there a need to access multiple DBs using the same connection pool?
    Just curious.

  • How to create Rows in Database with EJB3.0 Entities - Relationship Problem

    Hi,
    I don't have much experience in writing Entity Java Beans, so if some questions are "dummy-questions", I apologize for that.
    Actual state: I have implemented Entity Java Beans with relationships between them. I can deploy them to JBOSS AS and everything is fine. Then, I want to implement a small client to fill the database with some values to check if my Beans are correct.
    Problem: I have three Beans, that have relationships.
    Entity Flight, Entity FlightSeat and Entity Address
    Flight has a OneToMany relationship with FlightSeat and two ManyToOne relationships with Address (for start- and destinationaddress of the flight)
    No, I want to create Values in the database with the Entities, but I don't know how I have to conside the relationships. How can I add a Flight row to the database? Do I have to specifiy the start- and destinationaddress, when saving the entity Flight with Entitymanager.persist()?? Maybe you know a good Tutorial where I can see, how it is possible to fill the tables?
    Here my Implementation:
    Flight.java:
    package at.ac.tuwien.inetappl.entity;
    import java.io.Serializable;
    import javax.persistence.CascadeType;
    import javax.persistence.Column;
    import javax.persistence.Entity;
    import javax.persistence.GeneratedValue;
    import javax.persistence.GenerationType;
    import javax.persistence.Id;
    import javax.persistence.JoinColumn;
    import javax.persistence.ManyToOne;
    import javax.persistence.OneToMany;
    import javax.persistence.Table;
    import javax.persistence.FetchType;
    import java.util.Date;
    import java.util.Collection;
    @Entity
    @Table (name="REL_FLIGHT")
    public class Flight implements Serializable{
         private long flightid;
         private String company;
         private Date duration;
         private Address startaddress;
         private Address destinationaddress;
         private Collection<FlightSeat> seats;
         public Flight() {}
         public Flight(String company, Date duration, Address startaddress, Address destinationaddress)
              this.company=company;
              this.duration=duration;
              this.startaddress=startaddress;
              this.destinationaddress=destinationaddress;
         @Id @GeneratedValue(strategy=GenerationType.AUTO)
         @Column(name="FLIGHT_ID")
         public long getId()
              return this.flightid;
         public void setId(long flightid)
              this.flightid = flightid;
         @Column(name="COMPANY")
         public String getCompany()
              return this.company;
         public void setCompany(String company)
              this.company=company;          
         @Column(name="DURATION")
         public Date getDuration()
              return this.duration;
         public void setDuration(Date duration)
              this.duration=duration;
         @ManyToOne (optional=false)
         @JoinColumn(name = "START_ADDRESS_ID")
         public Address getStartAddress()
              return this.startaddress;
         public void setStartAddress(Address startaddress)
              this.startaddress=startaddress;
         @ManyToOne (optional=false)
         @JoinColumn(name = "DESTINATION_ADDRESS_ID")
         public Address getDestinationAddress()
              return this.destinationaddress;
         public void setDestinationAddress(Address destinationaddress)
              this.destinationaddress=destinationaddress;
         @OneToMany(cascade = CascadeType.ALL, fetch=FetchType.EAGER, mappedBy="flight")
         //@JoinColumn(name= "SEAT_ID")
         public Collection<FlightSeat> getSeats()
              return this.seats;
         public void setSeats(Collection<FlightSeat> seats)
              this.seats=seats;
    }Address.java:
    package at.ac.tuwien.inetappl.entity;
    import java.io.Serializable;
    import javax.persistence.Entity;
    import javax.persistence.GeneratedValue;
    import javax.persistence.GenerationType;
    import javax.persistence.Id;
    import javax.persistence.Table;
    import javax.persistence.Column;
    @Entity
    @Table (name="REL_ADDRESS")
    public class Address implements Serializable{
         private String land;
         private String city;
         private String street;
         private int streetnumber;
         private int postalcode;
         private long addressid;
         public Address() {}
         public Address (String land, String city, String street,
                   int streetnumber, int postalcode) {
              this.land=land;
              this.city=city;
              this.street=street;
              this.streetnumber=streetnumber;
              this.postalcode=postalcode;          
         @Id @GeneratedValue(strategy=GenerationType.AUTO)
         @Column(name="ADDRESS_ID")
         public long getId()
              return this.addressid;
         public void setId(long addressid)
              this.addressid = addressid;
         @Column(name="LAND")
         public String getLand()
              return this.land;
         public void setLand(String land)
              this.land=land;
         @Column(name="CITY")
         public String getCity()
              return this.city;
         public void setCity(String city)
              this.city=city;          
         @Column(name="STREET")
         public String getStreet()
              return this.street;
         public void setStreet(String street)
              this.street=street;
         @Column(name="STREETNUMBER")
         public int getStreetNumber()
              return this.streetnumber;
         public void setStreetNumber(int streetnumber)
              this.streetnumber=streetnumber;
         @Column(name="POSTALCODE")
         public int getPostalCode()
              return this.postalcode;
         public void setPostalCode(int postalcode)
              this.postalcode=postalcode;
    /code]
    FlightSeat.java package at.ac.tuwien.inetappl.entity;
    import java.io.Serializable;
    import javax.persistence.Column;
    import javax.persistence.GeneratedValue;
    import javax.persistence.GenerationType;
    import javax.persistence.Id;
    import javax.persistence.Entity;
    import javax.persistence.JoinColumn;
    import javax.persistence.ManyToOne;
    import javax.persistence.Table;
    @Entity
    @Table (name="REL_FLIGHTSEAT")
    public class FlightSeat implements Serializable {
         private long seatid;
         private String category;
         private int price;
         private boolean available;
         private Flight flight;
         public FlightSeat() {}
         public FlightSeat(String category, int price, boolean available)
              this.category=category;
              this.price=price;
              this.available=available;
         @Id @GeneratedValue(strategy=GenerationType.AUTO)
         @Column(name="SEAT_ID")
         public long getId()
              return this.seatid;
         public void setId(long seatid)
              this.seatid = seatid;
         @Column(name="CATEGORY")
         public String getCategory()
              return this.category;
         public void setCategory(String category)
              this.category=category;
         @Column(name="PRICE")
         public int getPrice()
              return this.price;
         public void setPrice(int price)
              this.price=price;
         @Column(name="AVAILABLE")
         public boolean getAvailability()
              return this.available;
         public void setAvailability(boolean available)
              this.available=available;
         @ManyToOne()
         @JoinColumn(name="FLIGHT_ID")
         public Flight getFlight()
              return this.flight;
         public void setFlight(Flight flight)
              this.flight=flight;
    FlightBean.java - implementing business methods
    package at.ac.tuwien.inetappl.bean;
    import javax.ejb.Stateless;
    import javax.persistence.EntityManager;
    import javax.persistence.PersistenceContext;
    import javax.ejb.Remote;
    import at.ac.tuwien.inetappl.entity.Flight;
    import at.ac.tuwien.inetappl.entity.Address;
    import at.ac.tuwien.inetappl.entity.FlightSeat;
    import java.util.Collection;
    import java.util.Date;
    import java.util.Iterator;
    import java.io.Serializable;
    import javax.persistence.Query;
    @Stateless
    @Remote(FlightInterface.class)
    public class FlightBean implements FlightInterface, java.io.Serializable {
         //private Collection<Flight> flight;
         @PersistenceContext
         protected EntityManager em;
         /* CRUD METHODS FOR FLIGHT */
         /* CREATE FLIGHT */
         public void createFlight(String company, Date duration, Address start, Address dest)
              Flight flight = new Flight();
              flight.setCompany(company);
              flight.setDuration(duration);
              flight.setStartAddress(start);
              flight.setDestinationAddress(dest);
              em.persist(flight);     
         public void updateFlight(Flight flight)
              em.persist(flight);
         /* DELETE FLIGHT*/
         public void deleteFlight(long id)
               Query q = em.createQuery("DELETE FROM FLIGHT f WHERE f.FLIGHT_ID = :id");
               q.setParameter ("id", new Long(id));
         /* SEARCH METHODS FOR FLIGHT */
         public Collection<Flight> getFlights()
              return em.createQuery("from FLIGHT f").getResultList();
         public Flight getFlight(long id) {
              Flight flight = em.find(Flight.class, new Long(id));
              return flight;
         public String getCompany(long id) {
              Flight flight = em.find(Flight.class, new Long(id));
              String company = flight.getCompany();
              return company;
    }Thanks to all!! I hope somebody can help.
    Greetings,
    RedBaron

    On Wed, 16 May 2007 20:41:21 +0000 (UTC), "bsoliman"
    <[email protected]> wrote:
    >You need to set up virtual directories instead?see
    >
    http://support.microsoft.com/kb/172138
    The actual directories can be wherever
    >is most convenient for you?I keep mine in a folder called
    /clients outside my
    >local web root.
    >
    > Bev
    Understand that virtual directories are not exactly the same
    thing as
    virtual hosts.
    A virtual directory will not act as the root for a site. IIS
    will
    still think that your site root is the overall IIS site root.
    There are some utilities that allow you to switch the folder
    that IIS
    uses as the root. This one works pretty well:
    http://jetstat.com/iisadmin/
    Win
    Win Day, Wild Rose Websites
    http://www.wildrosewebsites.com
    [email protected]
    Skype winifredday

Maybe you are looking for

  • Using LCD TV as Display

    I have a 12-inch iBook G4, and I wanted to use my LCD screen as my display. I bought a Apple Mini-DVI to Video Adapter, when I connected it up the picture looked grainy. It looks like it wasn't scaled up just blown up (if you understand that). I can

  • HT1727 how to share my itunes with my android phone for free?

    How to share my itunes with my android htc and samsung gallaxy phones.At one time paid for but will not sync anymore song.

  • Ipod nano not synching with itunes:  HELP!!

    I just purchased an ipod nano and tried to synch with the latest version of itunes. I'm unable to synch and get an error -53. Does anyone know of this error? I tried calling support and was on the phone for over 3 hours and was unable to receive any

  • ORA-01722

    Hi all, I can't believe in this. I have created a table workers with following columns: "L01_WORKERS_ID" NUMBER NOT NULL, "TITEL" VARCHAR2(4000), "LAST_NAME" VARCHAR2(4000), "FIRST_NAME" VARCHAR2(4000), "DATABASE_ACCOUNT" VARCHAR2(4000), "JOB_POSITIO

  • OBIEE and SQL

    All, I have been asked to find the answer to question. We are currently looking at a solution, but wish to know if we have the stored in SQL Server 2008 R2, could we sit an Oracle Repository and OBIEE 11g on top of this or would we need to either: