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

Similar Messages

  • Creating a Standby Database with the Same Directory Structure

    Hello gurus,
    I am self-learning the feature Oracle Data Guard, so I am testing it on Oracle 10g R2.
    At Oracle documentation there is a section F.4.: Creating a Standby Database with the Same Directory Structure*, that explains how to create a standby database with RMAN but there is something that I don´t understand:
    In the standby server, I created a database with the SID equal to production database* with the objetive to have the same directory structure, but when I try to startup nomount the standby database with pfile appear this expected error:
    ORA-16187: LOG_ARCHIVE_CONFIG contains duplicate, conflicting or invalid attributes
    So my question is: Is possible have the Same Directory Structure on both: Production and StandBy server?
    Thanks in advanced.

    Uwe and mseberg: thanks for your quick answers
    I have a doubt: How can you have the same directory structure if you have differents SIDs?, for example if you follow the OFA suggestions you would must have:
    On Production server: */u01/app/oracle/oradata/PRIMARY/system.dbf*
    On StandBy server: */u01/app/oracle/oradata/STANDBY/system.dbf*
    Or you created the directory structure manually on StandBy server? For example replacing the string STANDBY* to PRIMARY* before create the database using dbca.
    Do you understand my doubt? Excuse me for my english.
    Thanks.

  • How to create a Dynamic Datatable with sorting functioanlity

    Hi,
    I am new to JSF and need some help can some one please tell me how to create a dynamic datatable with sorting functionality. I am reading data data from a database table and wants to build the datatable dynamically based on the columns returned. I know how to created a datatble with a fixed number of columns but can't figure out how to create a datatable dynamically with sort functionality. Any small example will help.
    Thanks

    Hi,
    Here is what I have so far and can't figure out how to add the sorting functionality. Any help is appreciated.
    Managed Bean:
    private List<MyDto> data ;
        public HtmlDataTable getDataTableOne ()
            if ( dataTableOne == null )
                populateCheckBoxes () ; // Preload.
                populateDynamicDataTableOne () ;
            return dataTableOne ;
        public void populateCheckBoxes ()
            data = new ArrayList<MyDto> () ;
            MyDto myDto1 = new MyDto () ;
            MyDto myDto2 = new MyDto () ;
            MyDto myDto3 = new MyDto () ;
            MyDto myDto4 = new MyDto () ;
            myDto1.setChecked ( true ) ;
            myDto1.setValue ( "myDto1" ) ;
            myDto2.setChecked ( false ) ;
            myDto2.setValue ( "myDto2" ) ;
            myDto3.setChecked ( false ) ;
            myDto3.setValue ( "myDto3" ) ;
            myDto4.setChecked ( true ) ;
            myDto4.setValue ( "myDto4" ) ;
            data.add ( myDto1 ) ;
            data.add ( myDto2 ) ;
            data.add ( myDto3 ) ;
            data.add ( myDto4 ) ;
        public void populateDynamicDataTableOne ()
            dataTableOne = new HtmlDataTable () ;
            UIOutput header = new UIOutput () ;
            header.setValue ( "" ) ;
            UIColumn tableColumn ;
            tableColumn = new UIColumn () ;
            HtmlOutputText textHeader = new HtmlOutputText () ;
            textHeader.setValue ( "" ) ;
            tableColumn.setHeader ( textHeader ) ;
            HtmlSelectBooleanCheckbox tCheckBox = new HtmlSelectBooleanCheckbox () ;
            tCheckBox.setValueBinding ( "value" , FacesContext.getCurrentInstance ().getApplication ().createValueBinding ( "#{row.checked}" ) ) ;
            tableColumn.getChildren ().add ( tCheckBox ) ;
            // Set output.
            UIOutput output = new UIOutput () ;
            ValueBinding myItem = FacesContext.getCurrentInstance ().getApplication ().createValueBinding ( "#{row.value}" ) ;
            output.setValueBinding ( "value" , myItem ) ;
            // Set header (optional).
            UIOutput header2 = new UIOutput () ;
            header2.setValue ( "" ) ;
            UIColumn column = new UIColumn () ;
            column.setHeader ( header2 ) ;
            column.getChildren ().add ( output ) ;
            dataTableOne.getChildren ().add ( tableColumn ) ;
            dataTableOne.getChildren ().add ( column ) ;
    MyDto.java
    public class MyDto
        private Boolean checked;
        private String value;
        public MyDto ()
        public void setChecked ( Boolean checked )
            this.checked = checked;
        public Boolean getChecked ()
            return checked ;
        public void setValue ( String value )
            this.value = value;
        public String getValue ()
            return value ;
    JSP
    <h:dataTable id="table" value="#{myRequestBean.data}" binding="#{myRequestBean.dataTableOne}" var="row" />Thanks

  • How to create an explain plan with rowsource statistics for a complex query that include multiple table joins ?

    1. How to create an explain plan with rowsource statistics for a complex query that include multiple table joins ?
    When multiple tables are involved , and the actual number of rows returned is more than what the explain plan tells. How can I find out what change is needed  in the stat plan  ?
    2. Does rowsource statistics gives some kind of  understanding of Extended stats ?

    You can get Row Source Statistics only *after* the SQL has been executed.  An Explain Plan midway cannot give you row source statistics.
    To get row source statistics either set STATISTICS_LEVEL='ALL'  in the session that executes theSQL OR use the Hint "gather_plan_statistics"  in the SQL being executed.
    Then use dbms_xplan.display_cursor
    Hemant K Chitale

  • How to create a new database in SUP

    Hi,
    Iam using SUP 2.1 ESD#1 licensed version
    How to create a new database other than the default sampleDB.
    Thanks,
    B.Ushasri

    Hi B.Ushasri,
    This is actually pretty easy.
    1) open the Unwired Workspace (SDK in eclipse).
    2) Bottom right, add a new Database connection with the following details:
               Sybase ASA v12.x,
               host=Your Sup box,
               port=5500,
               user=dba
               password= Your password (default = dba)
    3) Once you connect successfully, right click on the connection and choose the "Create database" option.
    That should do it for you. It is the same connection as the sampleDB connection so if you already have that defined then its a simple, right click on it once connected and hit create database.
    Hope that helps,
    Brenton.

  • How to Create A new Database in the oracle 10g XE

    i have oracle 10g XE i tried to create a new database but its giveing me error when i execute the sql command that is create database testDatabase how to create a new database in oracle 10g XE

    Hi there 785434,
    (This is a generic SQL question relating to Database Triggers, please post future questions of this type into the relevant forum area.)
    Moderator, please move this if able
    I use Before Update and Before Delete Triggers to record a 'snapshot' of the row being changed in my applications.
    Example:
    CREATE TABLE TEST
    DATA VARCHAR2(64 CHAR),
    CREATING_USERID VARCHAR2(20 CHAR) DEFAULT user NOT NULL,
    CREATED_DATE DATE NOT NULL,
    CHANGED_BY_USERID VARCHAR2(20 CHAR),
    CHANGED_DATE DATE
    LOGGING
    STORAGE
    (MAXEXTENTS UNLIMITED);
    CREATE TABLE TEST_HISTORY
    DATA VARCHAR2(64 CHAR),
    CREATING_USERID VARCHAR2(20 CHAR) DEFAULT user NOT NULL,
    CREATED_DATE DATE NOT NULL,
    CHANGED_BY_USERID VARCHAR2(20 CHAR),
    CHANGED_DATE DATE,
    CHANGE_DESCRIPTION
    NOLOGGING
    STORAGE
    (MAXEXTENTS UNLIMITED);
    CREATE OR REPLACE TRIGGER TRG_BU_TEST
    BEFORE UPDATE ON TEST FOR EACH ROW
    BEGIN
    INSERT /*+ append */ INTO TEST_HISTORY
    (DATA, CREATING_USERID, CREATED_DATE, CHANGED_BY_USERID, CHANGED_DATE, CHANGE_DESCRIPTION)
    VALUES
    (:old.DATA, :old.CREATING_USERID, :old.CREATED_DATE, USER, SYSDATE, 'UPDATE');
    END;
    CREATE OR REPLACE TRIGGER TRG_BD_TEST
    BEFORE DELETE ON TEST FOR EACH ROW
    BEGIN
    INSERT /*+ append */ INTO TEST_HISTORY
    (DATA, CREATING_USERID, CREATED_DATE, CHANGED_BY_USERID, CHANGED_DATE, CHANGE_DESCRIPTION)
    VALUES
    (:old.DATA, :old.CREATING_USERID, :old.CREATED_DATE, USER, SYSDATE, 'DELETE');
    END;
    Using triggers like this will record who made an update or delete to the database and record the row before it was changed.
    Note that this method might not be suitable for very high transaction rates.
    You will need to 'clear' these history tables as part of routine maintenance.
    Hope that this Helps.
    Ronald.

  • How to create a logical database?

    Hi,
    Can anyone tell me how to create a logical database? I am curious about it.
    Thanks.
    Awards will be provided.
    Best regards,
    Chris Gu

    Transaction code for creating Logical db is se36.
    Give the name as <ldbname>..
    Specify the table names and the sub nodes according to your heirarchy.The root node used is zxxx_product and child node is zxxx_orders
    The heirarchy used is ZXXX_PRODUCT---->ZXXX_ORDERS
    write the below code under selections ...
    Enable DYNAMIC SELECTIONS for selected nodes :
    SELECTION-SCREEN DYNAMIC SELECTIONS FOR TABLE zxxx_product.
    SELECTION-SCREEN DYNAMIC SELECTIONS FOR TABLE zxxx_orders.
    Enable FIELD SELECTION for selected nodes :
    SELECTION-SCREEN FIELD SELECTION FOR TABLE zxxx_product.
    SELECTION-SCREEN FIELD SELECTION FOR TABLE zxxx_orders.
    ***User defined blocks :
    ****Root node
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001 .
    SELECT-OPTIONS :
    so_pname FOR zxxx_product-prname ,
    so_pdelv FOR zxxx_product-prdeldate .
    SELECTION-SCREEN END OF BLOCK b1 .
    ****Child node
    SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-002 .
    SELECT-OPTIONS :
    so_odate FOR zxxx_orders-orddate ,
    so_oqty FOR zxxx_orders-ordqty .
    SELECTION-SCREEN END OF BLOCK b2 .
    write the below code under include include DBZXX_PRODUCTTOP
    TABLES : ZXXX_product, ZXXX_orders.
    DATA : gt_root TYPE table of ZXXX_product ,
    gt_chld TYPE table of ZXXX_orders .
    write the below code under source code...
    Call event GET Zxxx_PRODUCT
    FORM put_zxxx_product.
    TYPES : BEGIN OF ls_pid ,
    prodid TYPE zxxx_product-prodid,
    END OF ls_pid .
    DATA : lt_pid TYPE ls_pid OCCURS 0 ,
    lt_pid_tmp TYPE ls_pid OCCURS 0 .
    STATICS lv_first_time VALUE 'X'.
    STATICS ls_isroot_fields TYPE rsfs_tab_fields.
    STATICS ls_isroot_where TYPE rsds_where.
    STATICS ls_ischld_fields TYPE rsfs_tab_fields.
    STATICS ls_ischld_where TYPE rsds_where.
    IF lv_first_time EQ 'X'.
    CLEAR lv_first_time.
              o
                    + Declarations for field selection for node Zxxx_PRODUCT ***
    " move table name to the corresponding field
    MOVE 'Zxxx_PRODUCT' TO ls_isroot_fields-tablename.
    " Read values from selection screen
    READ TABLE select_fields WITH KEY ls_isroot_fields-tablename
    INTO ls_isroot_fields.
    " move table name to the corresponding field
    MOVE 'Zxxx_PRODUCT' TO ls_isroot_where-tablename.
    " Read values from dynamic selection screen
    READ TABLE dyn_sel-clauses WITH KEY ls_isroot_where-tablename
    INTO ls_isroot_where.
              o
                    + Declarations for field selection for child node Zxxx_ORDERS ***
    MOVE 'Zxxx_ORDERS' TO ls_ischld_fields-tablename.
    READ TABLE select_fields WITH KEY ls_ischld_fields-tablename
    INTO ls_ischld_fields.
    MOVE 'Zxxx_ORDERS' TO ls_ischld_where-tablename.
    READ TABLE dyn_sel-clauses WITH KEY ls_ischld_where-tablename
    INTO ls_ischld_where.
    "...Check whether entry is made in atleast one selection field:
    IF NOT so_pname IS INITIAL OR
    NOT so_pdelv IS INITIAL OR
    NOT so_odate IS INITIAL OR
    NOT so_oqty IS INITIAL OR
    NOT ls_isroot_where-where_tab IS INITIAL OR
    NOT ls_ischld_where-where_tab IS INITIAL .
    "...Check whether entry is made in atleast one field in root node :
    IF NOT so_pname IS INITIAL OR
    NOT so_pdelv IS INITIAL OR
    NOT ls_isroot_where-where_tab IS INITIAL .
    SELECT prodid FROM Zxxx__product
    INTO CORRESPONDING FIELDS OF TABLE lt_pid
    WHERE prname IN so_pname AND
    prdeldate IN so_pdelv AND
    (ls_isroot_where-where_tab).
    "...Check whether entry is made in atleast one field in child node:
    IF NOT so_odate IS INITIAL OR
    NOT so_oqty IS INITIAL OR
    NOT ls_ischld_where-where_tab IS INITIAL AND
    NOT lt_pid IS INITIAL.
    SELECT prodid FROM Zxxx_orders
    INTO CORRESPONDING FIELDS OF TABLE lt_pid_tmp
    FOR ALL ENTRIES IN lt_pid
    WHERE prodid = lt_pid-prodid AND
    orddate IN so_odate AND
    ordqty IN so_oqty AND
    (ls_ischld_where-where_tab).
    lt_pid = lt_pid_tmp.
    ENDIF.
    ELSEIF NOT so_odate IS INITIAL OR
    NOT so_oqty IS INITIAL OR
    NOT ls_ischld_where-where_tab IS INITIAL.
    SELECT prodid FROM Zxxx_orders
    INTO CORRESPONDING FIELDS OF TABLE lt_pid
    WHERE orddate IN so_odate AND
    ordqty IN so_oqty AND
    (ls_ischld_where-where_tab).
    ENDIF.
    ******lt_pid contains all the selections based product ids
    ******Now retrieve all the records with the corresponding product ids
    CHECK NOT lt_pid IS INITIAL.
    IF NOT ls_isroot_fields IS INITIAL.
    SELECT (ls_isroot_fields-fields) FROM Zxxx_product
    INTO CORRESPONDING FIELDS OF TABLE gt_root
    FOR ALL ENTRIES IN lt_pid WHERE prodid = lt_pid-prodid.
    ENDIF.
    IF NOT ls_ischld_fields IS INITIAL AND
    NOT gt_root IS INITIAL.
    SELECT (ls_ischld_fields-fields) FROM Zxxx_orders
    INTO CORRESPONDING FIELDS OF TABLE gt_chld
    FOR ALL ENTRIES IN gt_root WHERE prodid = gt_root-prodid.
    ENDIF.
    LOOP AT gt_root INTO Zxxx_product.
    PUT Zxxx_product.
    ENDLOOP.
    ENDIF.
    ENDIF.
    ENDFORM.
    write the below code under
    include DBZXXX_PRODUCTNXXX -->
    include DBZXXX_PRODUCTN002 .
    form put_zxxx_orders
    LOOP AT gt_chld INTO zxxx_orders WHERE prodid = zxxx_product-prodid.
    PUT ZXXX_ORDERS.
    ENDLOOP.
    endform.
    now write a report program and call the ldb by its name using get
    get <ldbname>.
    Reward if this is useful.
    Regards,
    devi.
    Edited by: Devi Raju on Jul 15, 2008 9:13 AM

  • How to create a oracle database by java code?

    how to create a oracle database by java code?
    please give some ways then that way's code

    I'm not sure what you mean with "database". Do you mean an Oracle instance or an Oracle user/schema (probably the latter, because that's the equivalent to a MS SQL Database).
    Creating an instance is definitely not possible from within Java. To create a new user this should be possible, as this can be done with SQL:
    GRANT connect,resource TO <newuser> IDENTIFIED BY <password>;
    I'm always cautious with questions like this. In 90% of the cases there is something wrong with the initial design. Creating a database shouldn't be something the application is doing.
    Thomas

  • How to create a Cloning Database

    Dear all,
    Would you plz help me with How to create a Cloning Database in Oracle9i and Windows 2000 Server
    and how to automatically synchronize the cloned database with data
    Thanks,
    Ahmed Abd El Latif

    Oracle Data Guard Concepts and Administration
    http://download-west.oracle.com/docs/cd/B10501_01/server.920/a96653/toc.htm
    theres the answer to your question.
    In big detail.
    i hope it helps

  • How to create an Oracle DATABASE through Java Programming Language.. ?

    How to create an Oracle DATABASE through Java Programming Language.. ?

    Oracle database administrators tend to be control freaks, especially in financial institutions where security is paramount.
    In general, they will supply you with a database, but require you to supply all the DDL scripts to create tables, indexes, views etc.
    So a certain amount of manual installation will always be required.
    Typically you would supply the SQL scripts, and a detailled installation document too.
    regards,
    Owen

  • How to create dynamic connection string with variables using ssis.

    Hello,
    Can anyone let me know on how to create dynamic connection string with variables using ssis?
    Any help would be appreciated.

    Hi vinay9738,
    According to your description, you want to connect multiple database from multiple servers using dynamic connection.
    If in this case, we can create a Table in our local database (whatever DB we want) and load all the connection strings.  We can use Execute SQL Task to query all the connection strings and store the result-set in a variable of object type in SSIS package.
    Then use ForEach Loop container to shred the content of the object variable and iterate through each of the connection strings. And then Place an Execute SQL task inside ForEach Loop container with the SQL statements we have to run in all the DB instances. 
    For more details, please refer to the following blog:
    http://sql-developers.blogspot.kr/2010/07/dynamic-database-connection-using-ssis.html
    If there are any other questions, please feel free to let me know.
    Regards,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • How to create tree by database table

    hello sir ,
    my table is as follows,
    NAME LINK ID PID ROLLID
    User mgt. f?p=131:1: 1 - 10 ////root node///
    district 10 1 1 child
    Roles 16 14 4 child
    Users 11 10 1 child
    ROLLID is given from another table whis is (ROLES). i making tree by the combinations of id , pid, & roll id. by the roll id i can manage the tree to do not display specific nodes to specific users.
    ROLE table as :
    ROLE_ID NAME DESCRIPTION
    1 Administrator This is administrator
    2 Assistant Director -
    3 Assistant Statistical Officer -
    4 Data Entry Operator -
    but i think it is very complicated process . give me solution about it
    also i have to give my images to each node. how can i do that?

    You already have a thread going about this: Re: how to create tree by database table .
    Scott

  • Is it possible to create a Clone database with the same name of source db ?

    Is it possible to create a Clone database with the same name of source db using RMAN ...
    DB version is 11.2.0.2
    Is it possible to clone a 11.2.0.2 database to 11.2.0.3 home location directly on a new server . If it starts in a upgrade mode , it is ok ....

    user11919409 wrote:
    Is it possible to create a Clone database with the same name of source db using RMAN ...
    yes
    >
    DB version is 11.2.0.2
    Is it possible to clone a 11.2.0.2 database to 11.2.0.3 home location directly on a new server . If it starts in a upgrade mode , it is ok ....yes
    Handle:     user11919409
    Status Level:     Newbie (10)
    Registered:     Dec 7, 2009
    Total Posts:     102
    Total Questions:     28 (22 unresolved)
    why do you waste time here when you rarely get any answers to your questions?

  • How to create an unsolved cube with awm???

    hi all,
    I readed the "Oracle Olap developer's guide to the Oalp api" and I found there's 2 type of Cube: Solved and Unsolved Cubes. And this document says: "... if all the data for a cube is specified by the DBA, then the cube is considered to be Solved. If some or all of the aggregate data must be calculated by Oracle OLap, then the cube is unsolved ..."
    I tried with awm 10.2.0.3.0A to create an unsolvedCube but I can't. All cubes I created are solvedCube. To know if a cube is solved or unsolved, I wrotte an program in Java to read informations of package mtm.
    Some one can tell me how to create an unsolved cube with AWM ou other soft please!

    SH is not a relational OLAP data model which is quite different from the GLOBAL schema which is based on an Analytic Workspace.
    If you change the aggregation method you will need to re-compute the whole cube which can be a very big job! You might be able to force the unsolved status be de-selecting all the levels on the Rules tab in AWM. However, I think by default analytic workspace OLAP models always provide a fully solved cube to the outside world. This is the nature of the multi-dimensional model.
    Relationally, as keys are located in separate columns a cube can be unsolved in that the key column only contains values for a single level from the corresponding dimension tables. If more than keys for different levels within the same dimension appear within the fact key column then the cube is deemed as being solved.
    Therefore, I am not sure you are going to get the information you require from the API. To changes the aggregation method you will have to switch off all pre-compute options and also disable the session cache to prevent previously calculated data being returned when you change the aggregation method.
    Hope this helps
    Keith Laker
    Oracle EMEA Consulting
    BI Blog: http://oraclebi.blogspot.com/
    DM Blog: http://oracledmt.blogspot.com/
    BI on Oracle: http://www.oracle.com/bi/
    BI on OTN: http://www.oracle.com/technology/products/bi/
    BI Samples: http://www.oracle.com/technology/products/bi/samples/

  • How to create a standby database?

    I am running Oracle 8.1.5 on Sun Solaris. How to create a standby database? Can somebody tell me the step-by-step procedure?

    Can you tell what version of Oracle you are running, because the steps can vary depending on your version.

Maybe you are looking for

  • Can 2 different podcasts have the same name?

    My friends and I have recently created a podcast and posted it to Itunes http://itunes.apple.com/us/podcast/the-get-a-life-podcast/id529624848 After we had posted for a while a member of our group discovered that another podcast had the same name: ht

  • Problem with file.listFiles() of File class??

    Hi all friends, Iam facing with one peculiar problem,Iam using [file.listfiles()] method of File class in my program and this method of file class introduced in Java2.Now when Iam runing on Mac OS classic(8 to 9)[it is my client requirement they can'

  • Launch application according to script/question result

    Hello I would like to install an application via ZENworks, but I need to ask the user if he wants to install it or not? Can I ask this to the user in a script and then launch another application (or the same) only if the user selected 'Yes' for examp

  • PS3 on mac using apple TV

    can i use apple tv to play ps3 on my mac

  • Customise the email sent via the "Share" feature in Sharepoint 2013

    We have modified a number of the alerts via the alerttemplates.xml file in the 15 hive already. We want to modify the the email that is generated when a user in Sharepoint 2013 selects "share" on a document. We specifically want to add something to