You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 57 Next »

pom.xml

<?xml version="1.0" encoding="ISO-8859-1"?>

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>org.apache.geronimo.samples</groupId>
        <artifactId>osgi</artifactId>
        <version>3.0-M2-SNAPSHOT</version>
    </parent>

    <artifactId>aries-datasource</artifactId>
    <name>Geronimo Plugins :: Shared Aries Sample Datasource</name>
    <packaging>car</packaging>

    <description>
        Shared datasource plugin for all aries samples
    </description>

    <dependencies>
        <dependency>
            <groupId>org.apache.geronimo.framework</groupId>
            <artifactId>geronimo-gbean-deployer</artifactId>
            <version>${geronimoVersion}</version>
            <type>car</type>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>org.apache.geronimo.configs</groupId>
            <artifactId>j2ee-deployer</artifactId>
            <version>${geronimoVersion}</version>
            <type>car</type>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>org.apache.geronimo.configs</groupId>
            <artifactId>connector-deployer-1_6</artifactId>
            <version>${geronimoVersion}</version>
            <type>car</type>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>org.apache.geronimo.configs</groupId>
            <artifactId>transaction-1_6</artifactId>
            <version>${geronimoVersion}</version>
            <type>car</type>
        </dependency>

        <dependency>
            <groupId>org.apache.geronimo.modules</groupId>
            <artifactId>geronimo-derby</artifactId>
            <version>${geronimoVersion}</version>
        </dependency>

        <dependency>
            <groupId>org.apache.geronimo.framework</groupId>
            <artifactId>geronimo-jdbc</artifactId>
            <version>${geronimoVersion}</version>
        </dependency>

        <dependency>
            <groupId>org.tranql</groupId>
            <artifactId>tranql-connector-derby-embed-xa</artifactId>
            <version>1.6</version>
            <type>rar</type>
            <!--<scope>provided</scope>-->
        </dependency>

    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.geronimo.buildsupport</groupId>
                <artifactId>car-maven-plugin</artifactId>
                <configuration>
                    <deploymentConfigs>
                        <deploymentConfig>${gbeanDeployer}</deploymentConfig>
                        <deploymentConfig>${j2eeDeployer}</deploymentConfig>
                        <deploymentConfig>${connectorDeployer}</deploymentConfig>
                    </deploymentConfigs>
                    <module>
                        <groupId>org.tranql</groupId>
                        <artifactId>tranql-connector-derby-embed-xa</artifactId>
                        <version>1.6</version>
                        <type>rar</type>
                    </module>
                    <useMavenDependencies>
                        <value>true</value>
                        <includeVersion>true</includeVersion>
                    </useMavenDependencies>                    
                </configuration>
            </plugin>
        </plugins>
    </build>

</project>

plan.xml
<?xml version="1.0" encoding="UTF-8"?>
<connector xmlns="http://geronimo.apache.org/xml/ns/j2ee/connector-1.2">
    <resourceadapter>
        <outbound-resourceadapter>
            <connection-definition>
                <connectionfactory-interface>javax.sql.DataSource</connectionfactory-interface>

                <connectiondefinition-instance>
                    <name>jdbc/blogdb</name>
                    <jndi-name>jdbc/blogdb</jndi-name>
                    <config-property-setting name="UserName"></config-property-setting>
                    <config-property-setting name="Password"></config-property-setting>
                    <config-property-setting name="DatabaseName">blogDB</config-property-setting>
                    <config-property-setting name="CreateDatabase">true</config-property-setting>
                    <connectionmanager>
                        <xa-transaction>
                            <transaction-caching/>
                        </xa-transaction>
                        <single-pool>
                            <max-size>100</max-size>
                            <blocking-timeout-milliseconds>5000</blocking-timeout-milliseconds>
                            <select-one-assume-match/>
                        </single-pool>
                    </connectionmanager>
                </connectiondefinition-instance>
                <connectiondefinition-instance>
                    <name>jdbc/blogdbnojta</name>
                    <jndi-name>jdbc/blogdbnojta</jndi-name>
                    <config-property-setting name="UserName"></config-property-setting>
                    <config-property-setting name="Password"></config-property-setting>
                    <config-property-setting name="DatabaseName">blogDB</config-property-setting>
                    <config-property-setting name="CreateDatabase">true</config-property-setting>
                    <connectionmanager>
                        <no-transaction/>
                        <single-pool>
                            <max-size>100</max-size>
                            <blocking-timeout-milliseconds>5000</blocking-timeout-milliseconds>
                            <select-one-assume-match/>
                        </single-pool>
                    </connectionmanager>
                </connectiondefinition-instance>


                <connectiondefinition-instance>
                    <name>jdbc/TradeDataSource</name>
                    <jndi-name>jdbc/TradeDataSource</jndi-name>
                    <config-property-setting name="UserName"></config-property-setting>
                    <config-property-setting name="Password"></config-property-setting>
                    <config-property-setting name="DatabaseName">tradedb</config-property-setting>
                    <config-property-setting name="CreateDatabase">true</config-property-setting>
                    <connectionmanager>
                        <xa-transaction>
                            <transaction-caching/>
                        </xa-transaction>
                        <single-pool>
                            <max-size>100</max-size>
                            <blocking-timeout-milliseconds>5000</blocking-timeout-milliseconds>
                            <select-one-assume-match/>
                        </single-pool>
                    </connectionmanager>
                </connectiondefinition-instance>
                <connectiondefinition-instance>
                    <name>jdbc/NoTxTradeDataSource</name>
                    <jndi-name>jdbc/NoTxTradeDataSource</jndi-name>
                    <config-property-setting name="UserName"></config-property-setting>
                    <config-property-setting name="Password"></config-property-setting>
                    <config-property-setting name="DatabaseName">tradedb</config-property-setting>
                    <config-property-setting name="CreateDatabase">true</config-property-setting>
                    <connectionmanager>
                        <no-transaction/>
                        <single-pool>
                            <max-size>100</max-size>
                            <blocking-timeout-milliseconds>5000</blocking-timeout-milliseconds>
                            <select-one-assume-match/>
                        </single-pool>
                    </connectionmanager>
                </connectiondefinition-instance>


            </connection-definition>
        </outbound-resourceadapter>
    </resourceadapter>


    <gbean name="DBInitializationTrader" class="org.apache.geronimo.connector.wrapper.DatabaseInitializationGBean">
<attribute name="sql">
create table holdingejb
  (purchaseprice decimal(10, 2),
   holdingid integer not null,
   quantity double not null,
   purchasedate timestamp,
   account_accountid integer,
   quote_symbol varchar(250),
   optLock integer);

alter table holdingejb
  add constraint pk_holdingejb primary key (holdingid);

create table accountprofileejb
  (address varchar(250),
   passwd varchar(250),
   userid varchar(250) not null,
   email varchar(250),
   creditcard varchar(250),
   fullname varchar(250),
   optLock integer);

alter table accountprofileejb
  add constraint pk_accountprofile2 primary key (userid);

create table quoteejb
  (low decimal(10, 2),
   open1 decimal(10, 2),
   volume double not null,
   price decimal(10, 2),
   high decimal(10, 2),
   companyname varchar(250),
   symbol varchar(250) not null,
   change1 double not null,
   optLock integer);

alter table quoteejb
  add constraint pk_quoteejb primary key (symbol);

create table keygenejb
  (keyval integer not null,
   keyname varchar(250) not null);

alter table keygenejb
  add constraint pk_keygenejb primary key (keyname);

create table accountejb
  (creationdate timestamp,
   openbalance decimal(10, 2),
   logoutcount integer not null,
   balance decimal(10, 2),
   accountid integer not null,
   lastlogin timestamp,
   logincount integer not null,
   PROFILE_USERID VARCHAR(250),
   optLock integer);

alter table accountejb
  add constraint pk_accountejb primary key (accountid);

create table orderejb
  (orderfee decimal(10, 2),
   completiondate timestamp,
   ordertype varchar(250),
   orderstatus varchar(250),
   price decimal(10, 2),
   quantity double not null,
   opendate timestamp,
   orderid integer not null,
   account_accountid integer,
   quote_symbol varchar(250),
   holding_holdingid integer,
   optLock integer);

alter table orderejb
  add constraint pk_orderejb primary key (orderid);

create index profile_userid on accountejb(profile_userid);
create index account_accountid on holdingejb(account_accountid);
create index account_accountidt on orderejb(account_accountid);
create index holding_holdingid on orderejb(holding_holdingid);
create index orderstatus on orderejb(orderstatus);
create index ordertype on orderejb(ordertype);
</attribute>
        <reference name="DataSource">
            <name>jdbc/TradeDataSource</name>
        </reference>
    </gbean>

    <gbean name="DBInitializationBlog" class="org.apache.geronimo.connector.wrapper.DatabaseInitializationGBean">
<attribute name="sql">
CREATE TABLE AUTHOR (email VARCHAR(255) NOT NULL, bio VARCHAR(255), displayName VARCHAR(255), dob TIMESTAMP, name VARCHAR(255), PRIMARY KEY (email));
CREATE TABLE AUTHOR_BLOGENTRY (AUTHOR_EMAIL VARCHAR(255), POSTS_ID BIGINT);
CREATE TABLE BLOGENTRY (id BIGINT NOT NULL, blogText VARCHAR(10000), publishDate TIMESTAMP, title VARCHAR(255), updatedDate TIMESTAMP, AUTHOR_EMAIL VARCHAR(255), PRIMARY KEY (id));
CREATE TABLE COMMENT (id BIGINT NOT NULL, comment VARCHAR(255), creationDate TIMESTAMP, AUTHOR_EMAIL VARCHAR(255), BLOGENTRY_ID BIGINT);
CREATE TABLE OPENJPA_SEQUENCE_TABLE (ID SMALLINT NOT NULL, SEQUENCE_VALUE BIGINT, PRIMARY KEY (ID));
CREATE INDEX I_THR_TRY_AUTHOR_EMAIL ON AUTHOR_BLOGENTRY (AUTHOR_EMAIL);
CREATE INDEX I_THR_TRY_ELEMENT ON AUTHOR_BLOGENTRY (POSTS_ID);
CREATE INDEX I_BLGNTRY_AUTHOR ON BLOGENTRY (AUTHOR_EMAIL);
DELETE FROM AUTHOR;
DELETE FROM AUTHOR_BLOGENTRY;
DELETE FROM BLOGENTRY;
DELETE FROM COMMENT;
DELETE FROM OPENJPA_SEQUENCE_TABLE;
</attribute>
        <reference name="DataSource">
            <name>jdbc/blogdb</name>
        </reference>
    </gbean>

</connector>
  • No labels