geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From xiam...@apache.org
Subject svn commit: r1360504 - in /geronimo/daytrader/branches/3.0: README bin/dbscripts/derby/createDerbyDB.bat bin/dbscripts/derby/createDerbyDB.sh
Date Thu, 12 Jul 2012 01:43:58 GMT
Author: xiaming
Date: Thu Jul 12 01:43:58 2012
New Revision: 1360504

URL: http://svn.apache.org/viewvc?rev=1360504&view=rev
Log:
Update derby db creation scripts and readme

Modified:
    geronimo/daytrader/branches/3.0/README
    geronimo/daytrader/branches/3.0/bin/dbscripts/derby/createDerbyDB.bat
    geronimo/daytrader/branches/3.0/bin/dbscripts/derby/createDerbyDB.sh

Modified: geronimo/daytrader/branches/3.0/README
URL: http://svn.apache.org/viewvc/geronimo/daytrader/branches/3.0/README?rev=1360504&r1=1360503&r2=1360504&view=diff
==============================================================================
--- geronimo/daytrader/branches/3.0/README (original)
+++ geronimo/daytrader/branches/3.0/README Thu Jul 12 01:43:58 2012
@@ -8,90 +8,48 @@ under the ASF license to further functio
 -----------
 |  BUILD  |
 -----------
-To build DayTrader, you need to have JDK 6 and Maven 2.0.9 or later
+To build Daytrader, you need to have JDK 6 and Maven 3.0.3 or later
 installed, which can be found at http://maven.apache.org.
-Once installed you can build DayTrader by executing the following command
+Once installed you can build Daytrader by executing the following command
 from the dayTrader root directory (the directory containing this README):
 
-        mvn clean install
-
-
+  $ mvn clean install
 
 
 -------------
 |  INSTALL  |
 -------------
-
-You will need to create the database and populate the initial data into the
-database.  Make sure Geronimo is started and the GERONIMO_HOME environment
-variable is defined.
-
-1. If you want to use the embedded Apache Derby database, you can populate
-tables and data by visiting http://localhost:8080/daytrader/ in your browser.
-
-2. If you want to use a DB2 database as a back-end database provider, please
-copy DB2 jdbc drivers to server's repository and then build and install the 
-daytrader-db2-datasource plugin before installing the daytrader-jetty/tomcat
-plugin.    
-
-3. If you want to use an Oracle database as a back-end database provider,
-please copy the ojdbc14.jar file from your oracle server to
-$GERONIMO_HOME\repository\oracle\ojdbc14\10g and rename the ojdbc14.jar to a
-maven-recognizable format like ojdbc14-10g.jar.  Then build and install the 
-daytrader-oracle-datasource plugin before installing the daytrader-jetty/tomcat
-plugin.
-
-
-Deployer
---------
-1. Create the sample's database tables according to your database provider:
-   - If you use the embedded Apache Derby database provider, please perform the
-     following steps:
-      a. Ensure you have JAVA_HOME and GERONIMO_HOME environment variables set
-      b. Execute these commands from a command prompt:
-           cd $DAYTRADER_HOME/bin/dbscripts/derby
-           createDerbyDB.[bat|sh]
-  - If you use another back-end database provider, please perform the following
-    steps:
-    To create the database tables:
-      a. Set up a database or reuse an existing database. For this sample, a
-         database named "tradedb" is used.
-      b. Create a user with a user name of "trade" and a password of "trade".
-         Grant appropriate permissions to this user.
-      c. Load the database schema for this user by running the following at a
-         DBM command window:
-         - For IBM DB2 Express-C and Universal Database (UDB):
-              db2 connect to tradedb
-              db2 -tvf bin\dbscripts\db2\Table.ddl
-         - For Oracle:
-              sqlplus trade/trade@tradedb @bin\dbscripts\oracle\Table.ddl
-    To prep the datasource:
-      a. Download your DBM's JDBC driver from an authorized source.
-      b. Copy this driver to the Geronimo repository, and rename it to a
-         maven-recognizable format.  For example,
-         - For IBM DB2 Express-C and Universal Database (UDB):
-              $GERONIMO_HOME/repository/
-         - For Oracle:
-              $GERONIMO_HOME/repository/oracle/ojdbc14/10g/ojdbc14-10g.jar
-      c. Modify the database resource adapter configuration in your XML plan
-         (see below) to your database environment.  For example, UserName,
-         Password, PortNumber, DatabaseName, ServerName.
-
-2. Use the deployer tool to install the application:
-   - Execute these commands from a command prompt:
-         cd $GERONIMO_HOME/bin
-         deploy.[bat|sh] deploy $DAYTRADER_HOME/javaee6/assemblies/daytrader-ear/target/daytrader-ear-[version].ear
$DAYTRADER_HOME/plans/<My plan>
-           where <My plan> is
-               For Apache Derby:  dayTrader-derby-plan.xml
-               For IBM DB2 v9.1:  dayTrader-db2-9.1-XA-plan.xml
-               For Oracle:        dayTrader-oracle-XA-plan.xml
-               For MS SQL Server: dayTrader-sqlserver-plan.xml
-
-3. Use the admin console to install the application:
-   - Under Applications -> Deploy new
-     a. Select the EAR file indicated above as your archive.
-     b. Select the XML file indicated above as your plan.
-     c. Ensure the checkbox is selected to "start app after install".
+1. Install proper JDBC driver jars into Geronimo before deployment. For example, to run daytrader
with IBM DB2, 
+   you need to install DB2 JDBC driver via admin console repository portlet, and name it
as following:
+    
+    <groupId>com.ibm.db2</groupId>
+    <artifactId>db2jcc</artifactId>
+    <version>8.2</version>
+    <type>jar</type>
+    
+    <groupId>com.ibm.db2</groupId>
+    <artifactId>db2jcc_license_cu</artifactId>
+    <version>8.2</version>
+    <type>jar</type>
+    
+2. Deploy daytrader to the server:
+   a. Via command line, execute these commands from a command prompt:
+         $ cd $GERONIMO_HOME/bin
+         $ deploy.[bat|sh] deploy $DAYTRADER_HOME/javaee6/assemblies/daytrader-ear/target/daytrader-ear-<version>.ear
$DAYTRADER_HOME/javaee6/plans/target/classes/<My plan>
+           - where <My plan> is
+               For Apache Derby:  daytrader-derby-xa-plan.xml
+               For IBM DB2:       daytrader-db2-xa-plan.xml
+               For Oracle:        daytrader-oracle-xa-plan.xml
+               For MySQL:         daytrader-mysql-xa-plan.xml
+               For Informix:      daytrader-informix-xa-plan.xml
+               For MS SQL Server: daytrader-informix-xa-plan.xml or daytrader-sqlserver-plan.xml
+               For Postgre:       daytrader-postgre-xa-plan.xml
+
+   b. Via admin console, use the admin console to install the application:
+     - Under Applications -> Deploy new
+     I. Select the EAR file indicated above as your archive.
+     II. Select the XML file indicated above as your plan.
+     III. Ensure the checkbox is selected to "start app after install".
 
 
 ---------
@@ -100,12 +58,13 @@ Deployer
 1. Access the dayTrader application at:
          http://<hostname>:<port>/daytrader (This is for traditional servlet
and jsp)
          http://<hostname>:<port>/daytrader/index.faces(This is for JSF)
-2. Before you begin using DayTraader, theres are a couple setup steps:
+2. Before you begin using Daytrader, theres are a couple setup steps:
+   - Re-create daytrader tables
    - Populate the database with a set of fictional users, stocks, prices, etc.
      by selecting:
          'Configuration -> (Re)-populate Trade Database'.
      Note: This may take a minute or two depending on your database server.
-   - After populating the database, the DayTrader Configuration options will
+   - After populating the database, the Daytrader Configuration options will
      appear.  Just accept the defaults.
 3. Now you can begin trading by going to:
          'Trading & Portfolios'   
@@ -113,9 +72,9 @@ Deployer
 ---------------
 |  UNINSTALL  |
 ---------------
-To uninstall DayTrader, issue the following commands:
+To uninstall Daytrader, issue the following commands:
 
-1. If you installed DayTrader as an application (EAR) using the deployer:
-      deploy.[bat|sh] undeploy org.apache.geronimo.daytrader.javaee6/daytrader/<version>/car
+1. If you installed Daytrader as an application (EAR) using the deployer:
+      deploy.[bat|sh] undeploy org.apache.geronimo.daytrader/daytrader/<version>/car
 
 

Modified: geronimo/daytrader/branches/3.0/bin/dbscripts/derby/createDerbyDB.bat
URL: http://svn.apache.org/viewvc/geronimo/daytrader/branches/3.0/bin/dbscripts/derby/createDerbyDB.bat?rev=1360504&r1=1360503&r2=1360504&view=diff
==============================================================================
--- geronimo/daytrader/branches/3.0/bin/dbscripts/derby/createDerbyDB.bat (original)
+++ geronimo/daytrader/branches/3.0/bin/dbscripts/derby/createDerbyDB.bat Thu Jul 12 01:43:58
2012
@@ -26,7 +26,7 @@ if not "%GERONIMO_HOME%" == "" goto GERO
 :GERONIMO_OK
 
 set DERBY_PATH=%GERONIMO_HOME%\repository\org\apache\geronimo\bundles\derby-all
-set DERBY_VER=10.6.1.0_1
+set DERBY_VER=10.8.2.2_1
 set CLASSPATH=%DERBY_PATH%\%DERBY_VER%\derby-all-%DERBY_VER%.jar
 
 @echo "Invoking IJ command line tool to create the database and tables...please wait"

Modified: geronimo/daytrader/branches/3.0/bin/dbscripts/derby/createDerbyDB.sh
URL: http://svn.apache.org/viewvc/geronimo/daytrader/branches/3.0/bin/dbscripts/derby/createDerbyDB.sh?rev=1360504&r1=1360503&r2=1360504&view=diff
==============================================================================
--- geronimo/daytrader/branches/3.0/bin/dbscripts/derby/createDerbyDB.sh (original)
+++ geronimo/daytrader/branches/3.0/bin/dbscripts/derby/createDerbyDB.sh Thu Jul 12 01:43:58
2012
@@ -1,42 +1,42 @@
-#!/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/geronimo/bundles/derby-all
-export DERBY_VER=10.6.1.0_1
-export CLASSPATH=${DERBY_PATH}/${DERBY_VER}/derby-all-${DERBY_VER}.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"
+#!/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/geronimo/bundles/derby-all
+export DERBY_VER=10.8.2.2_1
+export CLASSPATH=${DERBY_PATH}/${DERBY_VER}/derby-all-${DERBY_VER}.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"



Mime
View raw message