geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cjbly...@apache.org
Subject svn commit: r512341 - in /geronimo/daytrader/branches/1.2: bin/dbscripts/ bin/dbscripts/derby/ bin/dbscripts/derby/Table.ddl bin/dbscripts/derby/createDerbyDB.bat bin/dbscripts/derby/createDerbyDB.sh modules/derby/
Date Tue, 27 Feb 2007 17:51:39 GMT
Author: cjblythe
Date: Tue Feb 27 09:51:38 2007
New Revision: 512341

URL: http://svn.apache.org/viewvc?view=rev&rev=512341
Log:
DAYTRADER-35 Move/update db creation scripts

Added:
    geronimo/daytrader/branches/1.2/bin/dbscripts/
    geronimo/daytrader/branches/1.2/bin/dbscripts/derby/
    geronimo/daytrader/branches/1.2/bin/dbscripts/derby/Table.ddl
    geronimo/daytrader/branches/1.2/bin/dbscripts/derby/createDerbyDB.bat   (with props)
    geronimo/daytrader/branches/1.2/bin/dbscripts/derby/createDerbyDB.sh   (with props)
Removed:
    geronimo/daytrader/branches/1.2/modules/derby/

Added: geronimo/daytrader/branches/1.2/bin/dbscripts/derby/Table.ddl
URL: http://svn.apache.org/viewvc/geronimo/daytrader/branches/1.2/bin/dbscripts/derby/Table.ddl?view=auto&rev=512341
==============================================================================
--- geronimo/daytrader/branches/1.2/bin/dbscripts/derby/Table.ddl (added)
+++ geronimo/daytrader/branches/1.2/bin/dbscripts/derby/Table.ddl Tue Feb 27 09:51:38 2007
@@ -0,0 +1,102 @@
+--    Licensed to the Apache Software Foundation (ASF) under one or more
+--    contributor license agreements.  See the NOTICE file distributed with
+--    this work for additional information regarding copyright ownership.
+--    The ASF licenses this file to You under the Apache License, Version 2.0
+--    (the "License"); you may not use this file except in compliance with
+--    the License.  You may obtain a copy of the License at
+--
+--       http://www.apache.org/licenses/LICENSE-2.0
+--
+--    Unless required by applicable law or agreed to in writing, software
+--    distributed under the License is distributed on an "AS IS" BASIS,
+--    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+--    See the License for the specific language governing permissions and
+--    limitations under the License.
+
+CONNECT 'jdbc:derby://localhost:1527/DaytraderDatabase;create=true';
+
+DROP TABLE HOLDINGEJB;
+DROP TABLE ACCOUNTPROFILEEJB;
+DROP TABLE QUOTEEJB;
+DROP TABLE KEYGENEJB;
+DROP TABLE ACCOUNTEJB;
+DROP TABLE ORDEREJB;
+
+CREATE TABLE HOLDINGEJB
+  (PURCHASEPRICE DECIMAL(14, 2),
+   HOLDINGID INTEGER NOT NULL,
+   QUANTITY DOUBLE NOT NULL,
+   PURCHASEDATE TIMESTAMP,
+   ACCOUNT_ACCOUNTID INTEGER,
+   QUOTE_SYMBOL VARCHAR(250));
+
+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));
+
+ALTER TABLE ACCOUNTPROFILEEJB
+  ADD CONSTRAINT PK_ACCOUNTPROFILE2 PRIMARY KEY (USERID);
+
+CREATE TABLE QUOTEEJB
+  (LOW DECIMAL(14, 2),
+   OPEN1 DECIMAL(14, 2),
+   VOLUME DOUBLE NOT NULL,
+   PRICE DECIMAL(14, 2),
+   HIGH DECIMAL(14, 2),
+   COMPANYNAME VARCHAR(250),
+   SYMBOL VARCHAR(250) NOT NULL,
+   CHANGE1 DOUBLE NOT NULL);
+
+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(14, 2),
+   LOGOUTCOUNT INTEGER NOT NULL,
+   BALANCE DECIMAL(14, 2),
+   ACCOUNTID INTEGER NOT NULL,
+   LASTLOGIN TIMESTAMP,
+   LOGINCOUNT INTEGER NOT NULL,
+   PROFILE_USERID VARCHAR(250));
+
+ALTER TABLE ACCOUNTEJB
+  ADD CONSTRAINT PK_ACCOUNTEJB PRIMARY KEY (ACCOUNTID);
+
+CREATE TABLE ORDEREJB
+  (ORDERFEE DECIMAL(14, 2),
+   COMPLETIONDATE TIMESTAMP,
+   ORDERTYPE VARCHAR(250),
+   ORDERSTATUS VARCHAR(250),
+   PRICE DECIMAL(14, 2),
+   QUANTITY DOUBLE NOT NULL,
+   OPENDATE TIMESTAMP,
+   ORDERID INTEGER NOT NULL,
+   ACCOUNT_ACCOUNTID INTEGER,
+   QUOTE_SYMBOL VARCHAR(250),
+   HOLDING_HOLDINGID INTEGER);
+
+ALTER TABLE ORDEREJB
+  ADD CONSTRAINT PK_ORDEREJB PRIMARY KEY (ORDERID);
+
+CREATE INDEX ACCOUNT_USERID ON ACCOUNTEJB(PROFILE_USERID);
+CREATE INDEX HOLDING_ACCOUNTID ON HOLDINGEJB(ACCOUNT_ACCOUNTID);
+CREATE INDEX ORDER_ACCOUNTID ON ORDEREJB(ACCOUNT_ACCOUNTID);
+CREATE INDEX ORDER_HOLDINGID ON ORDEREJB(HOLDING_HOLDINGID);
+CREATE INDEX CLOSED_ORDERS ON ORDEREJB(ACCOUNT_ACCOUNTID,ORDERSTATUS);
+
+COMMIT;

Added: geronimo/daytrader/branches/1.2/bin/dbscripts/derby/createDerbyDB.bat
URL: http://svn.apache.org/viewvc/geronimo/daytrader/branches/1.2/bin/dbscripts/derby/createDerbyDB.bat?view=auto&rev=512341
==============================================================================
--- geronimo/daytrader/branches/1.2/bin/dbscripts/derby/createDerbyDB.bat (added)
+++ geronimo/daytrader/branches/1.2/bin/dbscripts/derby/createDerbyDB.bat Tue Feb 27 09:51:38
2007
@@ -0,0 +1,43 @@
+@REM   Licensed to the Apache Software Foundation (ASF) under one or more
+@REM   contributor license agreements.  See the NOTICE file distributed with
+@REM   this work for additional information regarding copyright ownership.
+@REM   The ASF licenses this file to You under the Apache License, Version 2.0
+@REM   (the "License"); you may not use this file except in compliance with
+@REM   the License.  You may obtain a copy of the License at
+@REM
+@REM      http://www.apache.org/licenses/LICENSE-2.0
+@REM
+@REM   Unless required by applicable law or agreed to in writing, software
+@REM   distributed under the License is distributed on an "AS IS" BASIS,
+@REM   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+@REM   See the License for the specific language governing permissions and
+@REM   limitations under the License.
+
+@echo off
+
+if not "%JAVA_HOME%" == "" goto JAVA_OK
+@echo Please define the JAVA_HOME environment variable.
+@goto END
+:JAVA_OK
+
+if not "%GERONIMO_HOME%" == "" goto GERONIMO_OK
+@echo Please define the GERONIMO_HOME environment variable.
+@goto END
+:GERONIMO_OK
+
+set DERBY_PATH=%GERONIMO_HOME%\repository\org\apache\derby
+set CLASSPATH=%DERBY_PATH%\derby\10.1.3.1\derby-10.1.3.1.jar
+set CLASSPATH=%CLASSPATH%;%DERBY_PATH%\derbynet\10.1.3.1\derbynet-10.1.3.1.jar
+set CLASSPATH=%CLASSPATH%;%DERBY_PATH%\derbytools\10.1.3.1\derbytools-10.1.3.1.jar
+set CLASSPATH=%CLASSPATH%;%DERBY_PATH%\derbyclient\10.1.3.1\derbyclient-10.1.3.1.jar
+
+@echo "Invoking IJ command line tool to create the database and tables...please wait"
+
+%JAVA_HOME%\bin\java -Dij.driver=org.apache.derby.jdbc.ClientDriver -Dij.protocol=jdbc:derby://localhost:1527/
org.apache.derby.tools.ij < Table.ddl
+
+@REM The following command launches the interactive ij command line utility
+@REM java -Dij.driver=org.apache.derby.jdbc.ClientDriver -Dij.protocol=jdbc:derby://localhost:1527/
org.apache.derby.tools.ij 
+
+@echo Table creation complete
+ 
+:END
\ No newline at end of file

Propchange: geronimo/daytrader/branches/1.2/bin/dbscripts/derby/createDerbyDB.bat
------------------------------------------------------------------------------
    svn:eol-style = CRLF

Propchange: geronimo/daytrader/branches/1.2/bin/dbscripts/derby/createDerbyDB.bat
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/daytrader/branches/1.2/bin/dbscripts/derby/createDerbyDB.sh
URL: http://svn.apache.org/viewvc/geronimo/daytrader/branches/1.2/bin/dbscripts/derby/createDerbyDB.sh?view=auto&rev=512341
==============================================================================
--- geronimo/daytrader/branches/1.2/bin/dbscripts/derby/createDerbyDB.sh (added)
+++ geronimo/daytrader/branches/1.2/bin/dbscripts/derby/createDerbyDB.sh Tue Feb 27 09:51:38
2007
@@ -0,0 +1,43 @@
+#!/bin/bash
+#
+#   Licensed to the Apache Software Foundation (ASF) under one or more
+#   contributor license agreements.  See the NOTICE file distributed with
+#   this work for additional information regarding copyright ownership.
+#   The ASF licenses this file to You under the Apache License, Version 2.0
+#   (the "License"); you may not use this file except in compliance with
+#   the License.  You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+#   Unless required by applicable law or agreed to in writing, software
+#   distributed under the License is distributed on an "AS IS" BASIS,
+#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#   See the License for the specific language governing permissions and
+#   limitations under the License.
+
+if [ "${JAVA_HOME}" = "" ]
+then
+  echo "Please define the JAVA_HOME environment variable."
+  exit
+fi
+
+if [ "${GERONIMO_HOME}" = "" ]
+then
+  echo "Please define the GERONIMO_HOME environment variable."
+  exit
+fi
+
+export DERBY_PATH=${GERONIMO_HOME}/repository/org/apache/derby
+export CLASSPATH=${DERBY_PATH}/derby/10.1.3.1/derby-10.1.3.1.jar
+export CLASSPATH=${CLASSPATH}:${DERBY_PATH}/derbynet/10.1.3.1/derbynet-10.1.3.1.jar
+export CLASSPATH=${CLASSPATH}:${DERBY_PATH}/derbytools/10.1.3.1/derbytools-10.1.3.1.jar
+export CLASSPATH=${CLASSPATH}:${DERBY_PATH}/derbyclient/10.1.3.1/derbyclient-10.1.3.1.jar
+
+echo "Invoking IJ command line tool to create the database and tables...please wait"
+
+${JAVA_HOME}/bin/java -Dij.driver=org.apache.derby.jdbc.ClientDriver -Dij.protocol=jdbc:derby://localhost:1527/
org.apache.derby.tools.ij < Table.ddl
+
+# The following command launches the interactive ij command line utility
+#${JAVA_HOME}/bin/java -Dij.driver=org.apache.derby.jdbc.ClientDriver -Dij.protocol=jdbc:derby://localhost:1527/
org.apache.derby.tools.ij 
+
+echo "Table creation complete"

Propchange: geronimo/daytrader/branches/1.2/bin/dbscripts/derby/createDerbyDB.sh
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/daytrader/branches/1.2/bin/dbscripts/derby/createDerbyDB.sh
------------------------------------------------------------------------------
    svn:executable = *

Propchange: geronimo/daytrader/branches/1.2/bin/dbscripts/derby/createDerbyDB.sh
------------------------------------------------------------------------------
    svn:keywords = Date Revision



Mime
View raw message