<?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>