Return-Path: Delivered-To: apmail-geronimo-scm-archive@www.apache.org Received: (qmail 77087 invoked from network); 11 Apr 2008 20:49:55 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 11 Apr 2008 20:49:55 -0000 Received: (qmail 96203 invoked by uid 500); 11 Apr 2008 20:49:55 -0000 Delivered-To: apmail-geronimo-scm-archive@geronimo.apache.org Received: (qmail 96166 invoked by uid 500); 11 Apr 2008 20:49:55 -0000 Mailing-List: contact scm-help@geronimo.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: dev@geronimo.apache.org List-Id: Delivered-To: mailing list scm@geronimo.apache.org Received: (qmail 96157 invoked by uid 99); 11 Apr 2008 20:49:55 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 11 Apr 2008 13:49:55 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 11 Apr 2008 20:49:08 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id A35391A9852; Fri, 11 Apr 2008 13:48:57 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r647303 [7/8] - in /geronimo/samples/branches/2.0: migration-ejb-bmp/ migration-ejb-bmp/config/ migration-ejb-bmp/config/geronimo/ migration-ejb-bmp/config/jboss/ migration-ejb-bmp/src/ migration-ejb-bmp/src/META-INF/ migration-ejb-bmp/src/... Date: Fri, 11 Apr 2008 20:48:42 -0000 To: scm@geronimo.apache.org From: ecraig@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080411204857.A35391A9852@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Added: geronimo/samples/branches/2.0/migration-jdbc/plan/mysql-geronimo-plan.xml URL: http://svn.apache.org/viewvc/geronimo/samples/branches/2.0/migration-jdbc/plan/mysql-geronimo-plan.xml?rev=647303&view=auto ============================================================================== --- geronimo/samples/branches/2.0/migration-jdbc/plan/mysql-geronimo-plan.xml (added) +++ geronimo/samples/branches/2.0/migration-jdbc/plan/mysql-geronimo-plan.xml Fri Apr 11 13:48:31 2008 @@ -0,0 +1,82 @@ + + + + + + + user + jdbcdatasource + 2.0 + car + + + + mysql + mysql-connector-java + 3.1.14-bin + jar + + + + + + + + javax.sql.DataSource + + + TradeDS + + root + + + password + + + com.mysql.jdbc.Driver + + + jdbc:mysql://localhost:3306/tradedb + + + false + + + org.tranql.connector.NoExceptionsAreFatalSorter + + + + + + 10 + 0 + + 5000 + + + 30 + + + + + + + + + + Propchange: geronimo/samples/branches/2.0/migration-jdbc/plan/mysql-geronimo-plan.xml ------------------------------------------------------------------------------ svn:eol-style = native Propchange: geronimo/samples/branches/2.0/migration-jdbc/plan/mysql-geronimo-plan.xml ------------------------------------------------------------------------------ svn:keywords = Date Revision Propchange: geronimo/samples/branches/2.0/migration-jdbc/plan/mysql-geronimo-plan.xml ------------------------------------------------------------------------------ svn:mime-type = text/xml Added: geronimo/samples/branches/2.0/migration-jdbc/sql/db.sql URL: http://svn.apache.org/viewvc/geronimo/samples/branches/2.0/migration-jdbc/sql/db.sql?rev=647303&view=auto ============================================================================== --- geronimo/samples/branches/2.0/migration-jdbc/sql/db.sql (added) +++ geronimo/samples/branches/2.0/migration-jdbc/sql/db.sql Fri Apr 11 13:48:31 2008 @@ -0,0 +1,118 @@ +-- 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. + + + + + +CREATE TABLE IF NOT EXISTS users + +(userid VARCHAR(15) PRIMARY KEY CHECK (NOT NULL), + +name VARCHAR(50), + +password VARCHAR(24), + +address VARCHAR(96), + +cash FLOAT) ; + + + + + +CREATE TABLE IF NOT EXISTS TradingAccount + +(userid VARCHAR(15), + + stockid VARCHAR(8), + + quantity INT); + + + + + +CREATE TABLE IF NOT EXISTS stocks + +(id VARCHAR(8) PRIMARY KEY CHECK (NOT NULL), + + name VARCHAR(100), + + price FLOAT); + + + +DELETE FROM users; + +DELETE FROM TradingAccount; + +DELETE FROM stocks; + + + +INSERT INTO users VALUES('srini', '6 Inch', + + 'cheemu','Madivala Bangalore',10000); + + + +INSERT INTO users VALUES('j2ee', 'Lee Whittaker', + + 'password','Tampa Florida',100000); + + + +INSERT INTO TradingAccount VALUES('j2ee','00000002',10); + +INSERT INTO TradingAccount VALUES('srini','00000001',100); + + + +INSERT INTO stocks VALUES('00000001',"BTDA",1.00); + +INSERT INTO stocks VALUES('00000002',"Hitech Software",2.00); + +INSERT INTO stocks VALUES('00000003',"Bill's Cold Storage",3.00); + +INSERT INTO stocks VALUES('00000004',"Colonel's Fried Chicken",300.00); + +INSERT INTO stocks VALUES('00000005',"Toyo Motors",30.00); + +INSERT INTO stocks VALUES('00000006',"Timbuctoo Airlines",53.00); + +INSERT INTO stocks VALUES('00000007',"Happy Undertakers",73.00); + +INSERT INTO stocks VALUES('00000008',"Wacko Brothers",54.00); + +INSERT INTO stocks VALUES('00000009',"Mental Studios",456.00); + +INSERT INTO stocks VALUES('00000013',"ASFG",54.89); + +INSERT INTO stocks VALUES('00000023',"BFG",564.50); + +INSERT INTO stocks VALUES('00000033',"Mack",3444.50); + +INSERT INTO stocks VALUES('00000043',"Ronan & Sons",7.50); + +INSERT INTO stocks VALUES('00000053',"Bulls & Bears",553.40); + +INSERT INTO stocks VALUES('00000343',"HGHU",456.00); + +INSERT INTO stocks VALUES('00000603',"TTTM",77.00); + +INSERT INTO stocks VALUES('00000463',"GRASF",88.00); + +commit; \ No newline at end of file Propchange: geronimo/samples/branches/2.0/migration-jdbc/sql/db.sql ------------------------------------------------------------------------------ svn:eol-style = native Propchange: geronimo/samples/branches/2.0/migration-jdbc/sql/db.sql ------------------------------------------------------------------------------ svn:keywords = Date Revision Propchange: geronimo/samples/branches/2.0/migration-jdbc/sql/db.sql ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: geronimo/samples/branches/2.0/migration-jdbc/src/com/dev/trade/bo/Stock.java URL: http://svn.apache.org/viewvc/geronimo/samples/branches/2.0/migration-jdbc/src/com/dev/trade/bo/Stock.java?rev=647303&view=auto ============================================================================== --- geronimo/samples/branches/2.0/migration-jdbc/src/com/dev/trade/bo/Stock.java (added) +++ geronimo/samples/branches/2.0/migration-jdbc/src/com/dev/trade/bo/Stock.java Fri Apr 11 13:48:31 2008 @@ -0,0 +1,56 @@ +/* +* 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. +*/ +package com.dev.trade.bo; + +public class Stock { + private String id = null; + private String name = null; + private float price = 0.0f; + private int quantity = 0; + + public Stock(String id, String name, float price, int quantity) { + this.id = id; + this.name = name; + this.price = price; + this.quantity = quantity; + } + public String getId() { + return id; + } + public void setId(String id) { + this.id = id; + } + public String getName() { + return name; + } + public void setName(String name) { + this.name = name; + } + public float getPrice() { + return price; + } + public void setPrice(float price) { + this.price = price; + } + public int getQuantity() { + return quantity; + } + public void setQuantity(int quantity) { + this.quantity = quantity; + } + +} Propchange: geronimo/samples/branches/2.0/migration-jdbc/src/com/dev/trade/bo/Stock.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: geronimo/samples/branches/2.0/migration-jdbc/src/com/dev/trade/bo/Stock.java ------------------------------------------------------------------------------ svn:keywords = Date Revision Propchange: geronimo/samples/branches/2.0/migration-jdbc/src/com/dev/trade/bo/Stock.java ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: geronimo/samples/branches/2.0/migration-jdbc/src/com/dev/trade/bo/User.java URL: http://svn.apache.org/viewvc/geronimo/samples/branches/2.0/migration-jdbc/src/com/dev/trade/bo/User.java?rev=647303&view=auto ============================================================================== --- geronimo/samples/branches/2.0/migration-jdbc/src/com/dev/trade/bo/User.java (added) +++ geronimo/samples/branches/2.0/migration-jdbc/src/com/dev/trade/bo/User.java Fri Apr 11 13:48:31 2008 @@ -0,0 +1,68 @@ +/* +* 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. +*/ +package com.dev.trade.bo; + +public class User { + + private String userId = null; + private String name = null; + private String password = null; + private String address = null; + private float cash = 0f; + + public User(String userId,String name,String password,String address,float cash){ + this.userId = userId; + this.name = name; + this.password = password; + this.address = address; + this.cash = cash; + } + + public String getAddress() { + return address; + } + public void setAddress(String address) { + this.address = address; + } + public String getName() { + return name; + } + public void setName(String name) { + this.name = name; + } + public String getPassword() { + return password; + } + public void setPassword(String password) { + this.password = password; + } + public String getUserId() { + return userId; + } + public void setUserId(String userId) { + this.userId = userId; + } + + public float getCash() { + return cash; + } + + public void setCash(float cash) { + this.cash = cash; + } + +} Propchange: geronimo/samples/branches/2.0/migration-jdbc/src/com/dev/trade/bo/User.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: geronimo/samples/branches/2.0/migration-jdbc/src/com/dev/trade/bo/User.java ------------------------------------------------------------------------------ svn:keywords = Date Revision Propchange: geronimo/samples/branches/2.0/migration-jdbc/src/com/dev/trade/bo/User.java ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: geronimo/samples/branches/2.0/migration-jdbc/src/com/dev/trade/dao/TradeDAO.java URL: http://svn.apache.org/viewvc/geronimo/samples/branches/2.0/migration-jdbc/src/com/dev/trade/dao/TradeDAO.java?rev=647303&view=auto ============================================================================== --- geronimo/samples/branches/2.0/migration-jdbc/src/com/dev/trade/dao/TradeDAO.java (added) +++ geronimo/samples/branches/2.0/migration-jdbc/src/com/dev/trade/dao/TradeDAO.java Fri Apr 11 13:48:31 2008 @@ -0,0 +1,493 @@ +/* +* 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. +*/ +package com.dev.trade.dao; + +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.List; + +import javax.naming.Context; +import javax.naming.InitialContext; +import javax.sql.DataSource; + +import com.dev.trade.bo.Stock; +import com.dev.trade.bo.User; +import com.dev.trade.exception.DBException; + +public class TradeDAO { + private Connection con; + + public TradeDAO() throws Exception { + + } + + public User getUserByUserId(String userId) throws DBException { + + User user = null; + try { + InitialContext initialContext = new InitialContext(); + Context envCtx = (Context) initialContext.lookup("java:comp/env"); + DataSource ds = (DataSource) envCtx.lookup("jdbc/TradeDB"); + con = ds.getConnection(); + } catch (Exception ex) { + + ex.getMessage(); + } + try { + String query = "select * from users where userid = ?"; + PreparedStatement pStmt = con.prepareStatement(query); + pStmt.setString(1, userId); + ResultSet rs = pStmt.executeQuery(); + while (rs.next()) { + user = new User(rs.getString(1), rs.getString(2), rs + .getString(3), rs.getString(4), rs.getFloat(5)); + } + pStmt.close(); + } catch (SQLException ex) { + ex.printStackTrace(); + throw new DBException(ex.getMessage()); + } + try { + con.close(); + } catch (SQLException ex) { + + throw new DBException(ex.getMessage()); + } + return user; + } + + public List getUserStocks(String userId) throws DBException { + List stocks = new ArrayList(); + try { + InitialContext initialContext = new InitialContext(); + Context envCtx = (Context) initialContext.lookup("java:comp/env"); + DataSource ds = (DataSource) envCtx.lookup("jdbc/TradeDB"); + con = ds.getConnection(); + } catch (Exception ex) { + + ex.getMessage(); + } + try { + String query = "select A.quantity,A.stockid,B.name,B.price from TradingAccount A,stocks B where A.userid = ? and A.stockid = B.id"; + PreparedStatement pStmt = con.prepareStatement(query); + pStmt.setString(1, userId); + Stock stock = null; + ResultSet rs = pStmt.executeQuery(); + while (rs.next()) { + stock = new Stock(rs.getString(2), rs.getString(3), rs + .getFloat(4), rs.getInt(1)); + stocks.add(stock); + } + pStmt.close(); + } catch (SQLException ex) { + ex.printStackTrace(); + throw new DBException(ex.getMessage()); + } + try { + con.close(); + } catch (SQLException ex) { + + throw new DBException(ex.getMessage()); + } + return stocks; + } + + public List getStocks() throws DBException { + List stocks = new ArrayList(); + try { + InitialContext initialContext = new InitialContext(); + Context envCtx = (Context) initialContext.lookup("java:comp/env"); + DataSource ds = (DataSource) envCtx.lookup("jdbc/TradeDB"); + con = ds.getConnection(); + } catch (Exception ex) { + + ex.getMessage(); + } + try { + String query = "select * from stocks"; + PreparedStatement pStmt = con.prepareStatement(query); + + Stock stock = null; + ResultSet rs = pStmt.executeQuery(); + while (rs.next()) { + stock = new Stock(rs.getString(1), rs.getString(2), rs + .getFloat(3), 0); + stocks.add(stock); + } + pStmt.close(); + } catch (SQLException ex) { + ex.printStackTrace(); + throw new DBException(ex.getMessage()); + } + try { + con.close(); + } catch (SQLException ex) { + + throw new DBException(ex.getMessage()); + } + return stocks; + } + + public float getUserCash(String userId) throws DBException { + float cash = 0; + try { + InitialContext initialContext = new InitialContext(); + Context envCtx = (Context) initialContext.lookup("java:comp/env"); + DataSource ds = (DataSource) envCtx.lookup("jdbc/TradeDB"); + con = ds.getConnection(); + } catch (Exception ex) { + + ex.getMessage(); + } + try { + String query = "select cash from users where userid = ?"; + PreparedStatement pStmt = con.prepareStatement(query); + pStmt.setString(1, userId); + ResultSet rs = pStmt.executeQuery(); + while (rs.next()) { + cash = rs.getFloat("cash"); + } + pStmt.close(); + } catch (SQLException ex) { + ex.printStackTrace(); + throw new DBException(ex.getMessage()); + } + try { + con.close(); + } catch (SQLException ex) { + + throw new DBException(ex.getMessage()); + } + return cash; + } + + public boolean buyStock(String userId, String stockId, int quantity) + throws DBException { + float cashAvailable = getUserCash(userId); + float costOfStock = getStockPrice(stockId); + float totalCost = costOfStock * quantity; + int availableStock = getStockQuantityForUser(userId, stockId); + cashAvailable = cashAvailable - totalCost; + availableStock = availableStock + quantity; + try { + InitialContext initialContext = new InitialContext(); + Context envCtx = (Context) initialContext.lookup("java:comp/env"); + DataSource ds = (DataSource) envCtx.lookup("jdbc/TradeDB"); + con = ds.getConnection(); + } catch (Exception ex) { + + ex.getMessage(); + } + + if (cashAvailable >= 0 && (availableStock != quantity)) { + try { + con.setAutoCommit(false); + if (setUserCash(userId, cashAvailable) + && setUserStock(userId, stockId, availableStock)) { + con.commit(); + } else { + con.rollback(); + } + con.setAutoCommit(true); + } catch (SQLException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + throw new DBException(e.getMessage()); + } + } else if (cashAvailable >= 0 && (availableStock == quantity)) { + try { + con.setAutoCommit(false); + if (setUserCash(userId, cashAvailable) + && addUserStock(userId, stockId, availableStock)) { + con.commit(); + } else { + con.rollback(); + } + con.setAutoCommit(true); + } catch (SQLException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + throw new DBException(e.getMessage()); + } + } else { + try { + con.close(); + } catch (SQLException ex) { + + throw new DBException(ex.getMessage()); + } + return false; + } + try { + con.close(); + } catch (SQLException ex) { + + throw new DBException(ex.getMessage()); + } + return true; + } + + public boolean sellStock(String userId, String stockId, int quantity) + throws DBException { + float cashAvailable = getUserCash(userId); + float costOfStock = getStockPrice(stockId); + float totalCost = costOfStock * quantity; + int availableStock = getStockQuantityForUser(userId, stockId); + cashAvailable = cashAvailable + totalCost; + availableStock = availableStock - quantity; + try { + InitialContext initialContext = new InitialContext(); + Context envCtx = (Context) initialContext.lookup("java:comp/env"); + DataSource ds = (DataSource) envCtx.lookup("jdbc/TradeDB"); + con = ds.getConnection(); + } catch (Exception ex) { + + ex.getMessage(); + } + if (availableStock >= 0) { + try { + con.setAutoCommit(false); + if (setUserCash(userId, cashAvailable) + && setUserStock(userId, stockId, availableStock)) { + con.commit(); + } else { + con.rollback(); + } + con.setAutoCommit(true); + } catch (SQLException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + throw new DBException(e.getMessage()); + } + + } else { + try { + con.close(); + } catch (SQLException ex) { + + throw new DBException(ex.getMessage()); + } + return false; + } + try { + con.close(); + } catch (SQLException ex) { + + throw new DBException(ex.getMessage()); + } + return true; + } + + public float getStockPrice(String stockId) throws DBException { + float stockPrice = 0f; + try { + InitialContext initialContext = new InitialContext(); + Context envCtx = (Context) initialContext.lookup("java:comp/env"); + DataSource ds = (DataSource) envCtx.lookup("jdbc/TradeDB"); + con = ds.getConnection(); + } catch (Exception ex) { + + ex.getMessage(); + } + try { + String query = "select price from stocks where id = ?"; + PreparedStatement pStmt = con.prepareStatement(query); + pStmt.setString(1, stockId); + ResultSet rs = pStmt.executeQuery(); + while (rs.next()) { + stockPrice = rs.getFloat("price"); + } + pStmt.close(); + } catch (SQLException ex) { + ex.printStackTrace(); + throw new DBException(ex.getMessage()); + } + try { + con.close(); + } catch (SQLException ex) { + + throw new DBException(ex.getMessage()); + } + return stockPrice; + } + + private boolean setUserCash(String userId, float cash) throws DBException { + int status = 0; + try { + String query = "update users set cash = ? where userid = ?"; + PreparedStatement pStmt = con.prepareStatement(query); + pStmt.setFloat(1, cash); + pStmt.setString(2, userId); + status = pStmt.executeUpdate(); + pStmt.close(); + } catch (SQLException ex) { + ex.printStackTrace(); + throw new DBException(ex.getMessage()); + } + if (status == 0) { + return false; + } else { + return true; + } + } + + // buy = true sell = false + private boolean setUserStock(String userId, String stockId, int quantity) + throws DBException { + int existingQuantity = 0; + int status = 0; + + try { + String query = "update TradingAccount set quantity = ? where stockid = ? and userid = ?"; + PreparedStatement pStmt = con.prepareStatement(query); + pStmt.setInt(1, quantity); + pStmt.setString(2, stockId); + pStmt.setString(3, userId); + status = pStmt.executeUpdate(); + pStmt.close(); + query = "delete from TradingAccount where quantity = ?"; + pStmt = con.prepareStatement(query); + pStmt.setInt(1, 0); + pStmt.executeUpdate(); + pStmt.close(); + } catch (SQLException ex) { + ex.printStackTrace(); + throw new DBException(ex.getMessage()); + } + if (status == 0) { + return false; + } else { + return true; + } + + } + + private boolean addUserStock(String userId, String stockId, int quantity) + throws DBException { + + int status = 0; + try { + String query = "insert into TradingAccount values (?,?,?)"; + PreparedStatement pStmt = con.prepareStatement(query); + pStmt.setInt(3, quantity); + pStmt.setString(2, stockId); + pStmt.setString(1, userId); + status = pStmt.executeUpdate(); + pStmt.close(); + } catch (SQLException ex) { + ex.printStackTrace(); + throw new DBException(ex.getMessage()); + } + if (status == 0) { + return false; + } else { + return true; + } + + } + + public int getStockQuantityForUser(String userId, String stockId) + throws DBException { + int existingQuantity = 0; + try { + InitialContext initialContext = new InitialContext(); + Context envCtx = (Context) initialContext.lookup("java:comp/env"); + DataSource ds = (DataSource) envCtx.lookup("jdbc/TradeDB"); + con = ds.getConnection(); + } catch (Exception ex) { + + ex.getMessage(); + } + + try { + String query = "select quantity from TradingAccount where userid = ? and stockid = ?"; + PreparedStatement pStmt = con.prepareStatement(query); + pStmt.setString(1, userId); + pStmt.setString(2, stockId); + ResultSet rs = pStmt.executeQuery(); + while (rs.next()) { + existingQuantity = rs.getInt("quantity"); + } + pStmt.close(); + } catch (SQLException ex) { + ex.printStackTrace(); + throw new DBException(ex.getMessage()); + } + try { + con.close(); + } catch (SQLException ex) { + + throw new DBException(ex.getMessage()); + } + return existingQuantity; + } + + public boolean addUser(String userId, String name, String password, + String address, float cash) throws DBException { + int status = 0; + try { + InitialContext initialContext = new InitialContext(); + Context envCtx = (Context) initialContext.lookup("java:comp/env"); + DataSource ds = (DataSource) envCtx.lookup("jdbc/TradeDB"); + con = ds.getConnection(); + } catch (Exception ex) { + + ex.getMessage(); + } + + try { + String query = "insert into users values (?,?,?,?,?)"; + PreparedStatement pStmt = con.prepareStatement(query); + pStmt.setString(1, userId); + pStmt.setString(2, name); + pStmt.setString(3, password); + pStmt.setString(4, address); + pStmt.setFloat(5, cash); + status = pStmt.executeUpdate(); + pStmt.close(); + } catch (SQLException ex) { + ex.printStackTrace(); + throw new DBException(ex.getMessage()); + } + if (status == 0) { + try { + con.close(); + } catch (SQLException ex) { + + throw new DBException(ex.getMessage()); + } + return false; + } else { + try { + con.close(); + } catch (SQLException ex) { + + throw new DBException(ex.getMessage()); + } + return true; + } + + } + + public void remove() throws DBException { + + } + +} Propchange: geronimo/samples/branches/2.0/migration-jdbc/src/com/dev/trade/dao/TradeDAO.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: geronimo/samples/branches/2.0/migration-jdbc/src/com/dev/trade/dao/TradeDAO.java ------------------------------------------------------------------------------ svn:keywords = Date Revision Propchange: geronimo/samples/branches/2.0/migration-jdbc/src/com/dev/trade/dao/TradeDAO.java ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: geronimo/samples/branches/2.0/migration-jdbc/src/com/dev/trade/exception/DBException.java URL: http://svn.apache.org/viewvc/geronimo/samples/branches/2.0/migration-jdbc/src/com/dev/trade/exception/DBException.java?rev=647303&view=auto ============================================================================== --- geronimo/samples/branches/2.0/migration-jdbc/src/com/dev/trade/exception/DBException.java (added) +++ geronimo/samples/branches/2.0/migration-jdbc/src/com/dev/trade/exception/DBException.java Fri Apr 11 13:48:31 2008 @@ -0,0 +1,26 @@ +/* +* 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. +*/ +package com.dev.trade.exception; + +public class DBException extends Exception { +public DBException(){ +super(); +} +public DBException(String message){ + super(message); + } +} Propchange: geronimo/samples/branches/2.0/migration-jdbc/src/com/dev/trade/exception/DBException.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: geronimo/samples/branches/2.0/migration-jdbc/src/com/dev/trade/exception/DBException.java ------------------------------------------------------------------------------ svn:keywords = Date Revision Propchange: geronimo/samples/branches/2.0/migration-jdbc/src/com/dev/trade/exception/DBException.java ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: geronimo/samples/branches/2.0/migration-jdbc/src/com/dev/trade/servlet/TradeDispatcherServlet.java URL: http://svn.apache.org/viewvc/geronimo/samples/branches/2.0/migration-jdbc/src/com/dev/trade/servlet/TradeDispatcherServlet.java?rev=647303&view=auto ============================================================================== --- geronimo/samples/branches/2.0/migration-jdbc/src/com/dev/trade/servlet/TradeDispatcherServlet.java (added) +++ geronimo/samples/branches/2.0/migration-jdbc/src/com/dev/trade/servlet/TradeDispatcherServlet.java Fri Apr 11 13:48:31 2008 @@ -0,0 +1,183 @@ +/* +* 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. +*/ +package com.dev.trade.servlet; + +import java.io.IOException; +import java.util.List; + +import javax.servlet.ServletException; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.servlet.http.HttpSession; + +import com.dev.trade.bo.User; +import com.dev.trade.dao.TradeDAO; +import com.dev.trade.exception.DBException; + +public class TradeDispatcherServlet extends HttpServlet { + + private TradeDAO tradeDAO = null; + + private HttpSession session = null; + + public void init() throws ServletException { + // TODO Auto-generated method stub + super.init(); + try { + tradeDAO = new TradeDAO(); + } catch (Exception e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + } + + protected void doGet(HttpServletRequest request, + HttpServletResponse response) throws ServletException, IOException { + try { + session = request.getSession(true); + session.removeAttribute("status"); + String page = request.getServletPath(); + if ("/login".equals(page)) { + String userId = (String) request.getParameter("user"); + String password = (String) request.getParameter("password"); + if (userId != null && password != null) { + User user = tradeDAO.getUserByUserId(userId); + session.setAttribute("user", user); + if (user != null && password.equals(user.getPassword())) { + page = "/stocks"; + session.setAttribute("userId", userId); + session.setAttribute("password", password); + List stocks = tradeDAO.getStocks(); + session.setAttribute("stocks", stocks); + } else { + page = "/login"; + session.setAttribute("status", + "Logon Failed Please Try Again!"); + } + } else { + page = "/login"; + } + + } else if ("/stocks".equals(page)) { + List stocks = tradeDAO.getStocks(); + session.setAttribute("stocks", stocks); + } else if ("/userstocks".equals(page)) { + String userId = (String) session.getAttribute("userId"); + List userStocks = tradeDAO.getUserStocks(userId); + session.setAttribute("userStocks", userStocks); + } else if ("/register".equals(page)) { + String userId = request.getParameter("user"); + String name = request.getParameter("name"); + String password = request.getParameter("password"); + String address = request.getParameter("address"); + float cash = Float + .parseFloat((request.getParameter("cash") == null) ? "0" + : request.getParameter("cash")); + if (userId != null && name != null && password != null + && address != null && cash != 0) { + User user = tradeDAO.getUserByUserId(userId); + if (user == null) { + boolean status = tradeDAO.addUser(userId, name, + password, address, cash); + if (status) { + page = "/login"; + } else { + page = "/register"; + session.setAttribute("status", + "Registration Failed Please Try Again!"); + } + } else { + page = "/register"; + session.setAttribute("status", + "Registration Failed User Already Exists!"); + } + + }else if (userId != null && name != null && password != null + && address != null && cash == 0) { + session.setAttribute("status", + "Registration Failed Not enough Cash!"); + page = "/register"; + + }else { + page = "/register"; + } + + } else if ("/sell".equals(page)) { + page = "/userstocks"; + String userId = (String) session.getAttribute("userId"); + String stockId = request.getParameter("select"); + int quantity = Integer.parseInt(request + .getParameter("sellQuantity")); + boolean status = tradeDAO.sellStock(userId, stockId, quantity); + if (!status) { + session + .setAttribute("status", + "Not Enough Stocks or Operation Failed Please Try Again!"); + } + List userStocks = tradeDAO.getUserStocks(userId); + session.setAttribute("userStocks", userStocks); + User user = tradeDAO.getUserByUserId(userId); + session.setAttribute("user", user); + } else if ("/buy".equals(page)) { + page = "/stocks"; + String userId = (String) session.getAttribute("userId"); + String stockId = request.getParameter("select"); + int quantity = Integer.parseInt(request + .getParameter("buyQuantity")); + boolean status = tradeDAO.buyStock(userId, stockId, quantity); + if (!status) { + session + .setAttribute("status", + "Not Enough Money or Operation Failed Please Try Again!"); + } + List userStocks = tradeDAO.getUserStocks(userId); + session.setAttribute("userStocks", userStocks); + User user = tradeDAO.getUserByUserId(userId); + session.setAttribute("user", user); + } + + request.getRequestDispatcher(page + ".jsp").forward(request, + response); + } catch (DBException e) { + throw new ServletException(e.getMessage()); + } catch (Exception ex) { + throw new ServletException(ex.getMessage()); + } + + } + + protected void doPost(HttpServletRequest request, + HttpServletResponse response) throws ServletException, IOException { + // TODO Auto-generated method stub + + doGet(request, response); + } + + public void destroy() { + // TODO Auto-generated method stub + super.destroy(); + try { + tradeDAO.remove(); + } catch (DBException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + +} Propchange: geronimo/samples/branches/2.0/migration-jdbc/src/com/dev/trade/servlet/TradeDispatcherServlet.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: geronimo/samples/branches/2.0/migration-jdbc/src/com/dev/trade/servlet/TradeDispatcherServlet.java ------------------------------------------------------------------------------ svn:keywords = Date Revision Propchange: geronimo/samples/branches/2.0/migration-jdbc/src/com/dev/trade/servlet/TradeDispatcherServlet.java ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: geronimo/samples/branches/2.0/migration-jdbc/web/descriptors/geronimo/geronimo-web.xml URL: http://svn.apache.org/viewvc/geronimo/samples/branches/2.0/migration-jdbc/web/descriptors/geronimo/geronimo-web.xml?rev=647303&view=auto ============================================================================== --- geronimo/samples/branches/2.0/migration-jdbc/web/descriptors/geronimo/geronimo-web.xml (added) +++ geronimo/samples/branches/2.0/migration-jdbc/web/descriptors/geronimo/geronimo-web.xml Fri Apr 11 13:48:31 2008 @@ -0,0 +1,43 @@ + + + + + + BrokerageApp + MySqlDS + 2.0 + car + + + + + user + jdbcdatasource + 2.0 + car + + + + +/brokerage + + + jdbc/TradeDB + TradeDS + + Propchange: geronimo/samples/branches/2.0/migration-jdbc/web/descriptors/geronimo/geronimo-web.xml ------------------------------------------------------------------------------ svn:eol-style = native Propchange: geronimo/samples/branches/2.0/migration-jdbc/web/descriptors/geronimo/geronimo-web.xml ------------------------------------------------------------------------------ svn:keywords = Date Revision Propchange: geronimo/samples/branches/2.0/migration-jdbc/web/descriptors/geronimo/geronimo-web.xml ------------------------------------------------------------------------------ svn:mime-type = text/xml Added: geronimo/samples/branches/2.0/migration-jdbc/web/descriptors/jboss-web.xml URL: http://svn.apache.org/viewvc/geronimo/samples/branches/2.0/migration-jdbc/web/descriptors/jboss-web.xml?rev=647303&view=auto ============================================================================== --- geronimo/samples/branches/2.0/migration-jdbc/web/descriptors/jboss-web.xml (added) +++ geronimo/samples/branches/2.0/migration-jdbc/web/descriptors/jboss-web.xml Fri Apr 11 13:48:31 2008 @@ -0,0 +1,25 @@ + + + + /brokerage + + jdbc/TradeDB + javax.sql.DataSource + java:jdbc/TradeDB + + \ No newline at end of file Propchange: geronimo/samples/branches/2.0/migration-jdbc/web/descriptors/jboss-web.xml ------------------------------------------------------------------------------ svn:eol-style = native Propchange: geronimo/samples/branches/2.0/migration-jdbc/web/descriptors/jboss-web.xml ------------------------------------------------------------------------------ svn:keywords = Date Revision Propchange: geronimo/samples/branches/2.0/migration-jdbc/web/descriptors/jboss-web.xml ------------------------------------------------------------------------------ svn:mime-type = text/xml Added: geronimo/samples/branches/2.0/migration-jdbc/web/descriptors/jboss/jboss-web.xml URL: http://svn.apache.org/viewvc/geronimo/samples/branches/2.0/migration-jdbc/web/descriptors/jboss/jboss-web.xml?rev=647303&view=auto ============================================================================== --- geronimo/samples/branches/2.0/migration-jdbc/web/descriptors/jboss/jboss-web.xml (added) +++ geronimo/samples/branches/2.0/migration-jdbc/web/descriptors/jboss/jboss-web.xml Fri Apr 11 13:48:31 2008 @@ -0,0 +1,25 @@ + + + + /brokerage + + jdbc/TradeDB + javax.sql.DataSource + java:jdbc/TradeDB + + \ No newline at end of file Propchange: geronimo/samples/branches/2.0/migration-jdbc/web/descriptors/jboss/jboss-web.xml ------------------------------------------------------------------------------ svn:eol-style = native Propchange: geronimo/samples/branches/2.0/migration-jdbc/web/descriptors/jboss/jboss-web.xml ------------------------------------------------------------------------------ svn:keywords = Date Revision Propchange: geronimo/samples/branches/2.0/migration-jdbc/web/descriptors/jboss/jboss-web.xml ------------------------------------------------------------------------------ svn:mime-type = text/xml Added: geronimo/samples/branches/2.0/migration-jdbc/web/descriptors/web.xml URL: http://svn.apache.org/viewvc/geronimo/samples/branches/2.0/migration-jdbc/web/descriptors/web.xml?rev=647303&view=auto ============================================================================== --- geronimo/samples/branches/2.0/migration-jdbc/web/descriptors/web.xml (added) +++ geronimo/samples/branches/2.0/migration-jdbc/web/descriptors/web.xml Fri Apr 11 13:48:31 2008 @@ -0,0 +1,63 @@ + + + +brokerage + +Trade-Dispatcher +TradeDispatcher +com.dev.trade.servlet.TradeDispatcherServlet + + +TradeDispatcher +/login + + +TradeDispatcher +/stocks + + +TradeDispatcher +/userstocks + + +TradeDispatcher +/buy + + +TradeDispatcher +/sell + + +TradeDispatcher +/register + + + /login.jsp + + + + javax.servlet.ServletException + /error.jsp + + +jdbc/TradeDB +javax.sql.DataSource +Container +Shareable + + Propchange: geronimo/samples/branches/2.0/migration-jdbc/web/descriptors/web.xml ------------------------------------------------------------------------------ svn:eol-style = native Propchange: geronimo/samples/branches/2.0/migration-jdbc/web/descriptors/web.xml ------------------------------------------------------------------------------ svn:keywords = Date Revision Propchange: geronimo/samples/branches/2.0/migration-jdbc/web/descriptors/web.xml ------------------------------------------------------------------------------ svn:mime-type = text/xml Added: geronimo/samples/branches/2.0/migration-jdbc/web/jsps/error.jsp URL: http://svn.apache.org/viewvc/geronimo/samples/branches/2.0/migration-jdbc/web/jsps/error.jsp?rev=647303&view=auto ============================================================================== --- geronimo/samples/branches/2.0/migration-jdbc/web/jsps/error.jsp (added) +++ geronimo/samples/branches/2.0/migration-jdbc/web/jsps/error.jsp Fri Apr 11 13:48:31 2008 @@ -0,0 +1,30 @@ + +<%@ page language="java" isErrorPage="true" %> + + +An Error Has Occurred + + + + +An Error Has Occurred. The Error is <%=exception.getMessage()%> + +
+ + + \ No newline at end of file Propchange: geronimo/samples/branches/2.0/migration-jdbc/web/jsps/error.jsp ------------------------------------------------------------------------------ svn:eol-style = native Propchange: geronimo/samples/branches/2.0/migration-jdbc/web/jsps/error.jsp ------------------------------------------------------------------------------ svn:keywords = Date Revision Propchange: geronimo/samples/branches/2.0/migration-jdbc/web/jsps/error.jsp ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: geronimo/samples/branches/2.0/migration-jdbc/web/jsps/login.jsp URL: http://svn.apache.org/viewvc/geronimo/samples/branches/2.0/migration-jdbc/web/jsps/login.jsp?rev=647303&view=auto ============================================================================== --- geronimo/samples/branches/2.0/migration-jdbc/web/jsps/login.jsp (added) +++ geronimo/samples/branches/2.0/migration-jdbc/web/jsps/login.jsp Fri Apr 11 13:48:31 2008 @@ -0,0 +1,42 @@ + +<%@page language="java"%> + + +Trader Login + + +
+ + + + + + + + + + + + + + + +
Online Brokerage
 
 
 
<%=(session.getAttribute("status")==null)?"":session.getAttribute("status")%>
User Name"/>
Password"/>
 
 
 
 
 
 
+
+ + \ No newline at end of file Propchange: geronimo/samples/branches/2.0/migration-jdbc/web/jsps/login.jsp ------------------------------------------------------------------------------ svn:eol-style = native Propchange: geronimo/samples/branches/2.0/migration-jdbc/web/jsps/login.jsp ------------------------------------------------------------------------------ svn:keywords = Date Revision Propchange: geronimo/samples/branches/2.0/migration-jdbc/web/jsps/login.jsp ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: geronimo/samples/branches/2.0/migration-jdbc/web/jsps/register.jsp URL: http://svn.apache.org/viewvc/geronimo/samples/branches/2.0/migration-jdbc/web/jsps/register.jsp?rev=647303&view=auto ============================================================================== --- geronimo/samples/branches/2.0/migration-jdbc/web/jsps/register.jsp (added) +++ geronimo/samples/branches/2.0/migration-jdbc/web/jsps/register.jsp Fri Apr 11 13:48:31 2008 @@ -0,0 +1,82 @@ + +<%@page language="java" import="com.dev.trade.bo.*" %> + + +Trader Registration + + + +
+ +<% if(request.getParameter("action")==null){ + session.removeAttribute("user"); + } +%> + + + + + +<% +User user = (User)session.getAttribute("user"); +%> + + + + + + + + + + + + +
Online Brokerage - Registration
 
 
 
<%=(session.getAttribute("status")==null)?"":session.getAttribute("status")%>
User Id" maxlength=15/>
User Name" maxlength=50/>
Password" maxlength=24/>
Address" maxlength=96/>
Cash
" value="Register" onClick="verifyAndSubmit()"/>
 
 
 
 
 
+
+ + \ No newline at end of file Propchange: geronimo/samples/branches/2.0/migration-jdbc/web/jsps/register.jsp ------------------------------------------------------------------------------ svn:eol-style = native Propchange: geronimo/samples/branches/2.0/migration-jdbc/web/jsps/register.jsp ------------------------------------------------------------------------------ svn:keywords = Date Revision Propchange: geronimo/samples/branches/2.0/migration-jdbc/web/jsps/register.jsp ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: geronimo/samples/branches/2.0/migration-jdbc/web/jsps/stocks.jsp URL: http://svn.apache.org/viewvc/geronimo/samples/branches/2.0/migration-jdbc/web/jsps/stocks.jsp?rev=647303&view=auto ============================================================================== --- geronimo/samples/branches/2.0/migration-jdbc/web/jsps/stocks.jsp (added) +++ geronimo/samples/branches/2.0/migration-jdbc/web/jsps/stocks.jsp Fri Apr 11 13:48:31 2008 @@ -0,0 +1,106 @@ + +<%@page language="java" import="java.util.List,com.dev.trade.bo.Stock" %> + + +Available Stocks + + + +
+ + + + + + + +<% List stocks = (List)session.getAttribute("stocks"); + Stock stock = null; + for (int i=0;i + + +<% } + %> + + +
Online Brokerage - Available Stocks
 
 
 
<%=(session.getAttribute("status")==null)?"":session.getAttribute("status")%>
Stock NameStock PriceQuantityBuy
<%=stock.getName()%><%=stock.getPrice()%>
View your Portfolio
+ + + +
+ + \ No newline at end of file Propchange: geronimo/samples/branches/2.0/migration-jdbc/web/jsps/stocks.jsp ------------------------------------------------------------------------------ svn:eol-style = native Propchange: geronimo/samples/branches/2.0/migration-jdbc/web/jsps/stocks.jsp ------------------------------------------------------------------------------ svn:keywords = Date Revision Propchange: geronimo/samples/branches/2.0/migration-jdbc/web/jsps/stocks.jsp ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: geronimo/samples/branches/2.0/migration-jdbc/web/jsps/userstocks.jsp URL: http://svn.apache.org/viewvc/geronimo/samples/branches/2.0/migration-jdbc/web/jsps/userstocks.jsp?rev=647303&view=auto ============================================================================== --- geronimo/samples/branches/2.0/migration-jdbc/web/jsps/userstocks.jsp (added) +++ geronimo/samples/branches/2.0/migration-jdbc/web/jsps/userstocks.jsp Fri Apr 11 13:48:31 2008 @@ -0,0 +1,109 @@ + +<%@page language="java" import="java.util.List,com.dev.trade.bo.*,com.dev.trade.dao.*" %> + + +Portfolio + + + +
+ + + + + + + + + +<% List stocks = (List)session.getAttribute("userStocks"); + Stock stock = null; + for (int i=0;i + + +<% } + %> + + +
Online Brokerage - Portfolio
 
 
 
<%=(session.getAttribute("status")==null)?"":session.getAttribute("status")%>
User Cash:<% User user = (User)session.getAttribute("user"); + out.print(user.getCash() );%>
Stock NameStock PriceQuantityQuantity to SellSelect
<%=stock.getName()%><%=stock.getPrice()%>
View Available Stocks
+ + + +
+ + Propchange: geronimo/samples/branches/2.0/migration-jdbc/web/jsps/userstocks.jsp ------------------------------------------------------------------------------ svn:eol-style = native Propchange: geronimo/samples/branches/2.0/migration-jdbc/web/jsps/userstocks.jsp ------------------------------------------------------------------------------ svn:keywords = Date Revision Propchange: geronimo/samples/branches/2.0/migration-jdbc/web/jsps/userstocks.jsp ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: geronimo/samples/branches/2.0/migration-servlets/WEB-INF/geronimo-web.xml URL: http://svn.apache.org/viewvc/geronimo/samples/branches/2.0/migration-servlets/WEB-INF/geronimo-web.xml?rev=647303&view=auto ============================================================================== --- geronimo/samples/branches/2.0/migration-servlets/WEB-INF/geronimo-web.xml (added) +++ geronimo/samples/branches/2.0/migration-servlets/WEB-INF/geronimo-web.xml Fri Apr 11 13:48:31 2008 @@ -0,0 +1,30 @@ + + + + + + + j2g + web-module + 1.0 + war + + + + college_fest + Propchange: geronimo/samples/branches/2.0/migration-servlets/WEB-INF/geronimo-web.xml ------------------------------------------------------------------------------ svn:eol-style = native Propchange: geronimo/samples/branches/2.0/migration-servlets/WEB-INF/geronimo-web.xml ------------------------------------------------------------------------------ svn:keywords = Date Revision Propchange: geronimo/samples/branches/2.0/migration-servlets/WEB-INF/geronimo-web.xml ------------------------------------------------------------------------------ svn:mime-type = text/xml Added: geronimo/samples/branches/2.0/migration-servlets/WEB-INF/jboss-web.xml URL: http://svn.apache.org/viewvc/geronimo/samples/branches/2.0/migration-servlets/WEB-INF/jboss-web.xml?rev=647303&view=auto ============================================================================== --- geronimo/samples/branches/2.0/migration-servlets/WEB-INF/jboss-web.xml (added) +++ geronimo/samples/branches/2.0/migration-servlets/WEB-INF/jboss-web.xml Fri Apr 11 13:48:31 2008 @@ -0,0 +1,25 @@ + + + + + + college_fest + + false + + Propchange: geronimo/samples/branches/2.0/migration-servlets/WEB-INF/jboss-web.xml ------------------------------------------------------------------------------ svn:eol-style = native Propchange: geronimo/samples/branches/2.0/migration-servlets/WEB-INF/jboss-web.xml ------------------------------------------------------------------------------ svn:keywords = Date Revision Propchange: geronimo/samples/branches/2.0/migration-servlets/WEB-INF/jboss-web.xml ------------------------------------------------------------------------------ svn:mime-type = text/xml Added: geronimo/samples/branches/2.0/migration-servlets/WEB-INF/web.xml URL: http://svn.apache.org/viewvc/geronimo/samples/branches/2.0/migration-servlets/WEB-INF/web.xml?rev=647303&view=auto ============================================================================== --- geronimo/samples/branches/2.0/migration-servlets/WEB-INF/web.xml (added) +++ geronimo/samples/branches/2.0/migration-servlets/WEB-INF/web.xml Fri Apr 11 13:48:31 2008 @@ -0,0 +1,47 @@ + + + + College Fest + + + + WelcomeServlet + WelcomeServlet + servlets.WelcomeServlet + + + PersonalServlet + PersonalServlet + servlets.PersonalServlet + + + WelcomeServlet + /welcome + + + PersonalServlet + /personal + + + + jsp/index.html + + + + + Propchange: geronimo/samples/branches/2.0/migration-servlets/WEB-INF/web.xml ------------------------------------------------------------------------------ svn:eol-style = native Propchange: geronimo/samples/branches/2.0/migration-servlets/WEB-INF/web.xml ------------------------------------------------------------------------------ svn:keywords = Date Revision Propchange: geronimo/samples/branches/2.0/migration-servlets/WEB-INF/web.xml ------------------------------------------------------------------------------ svn:mime-type = text/xml Added: geronimo/samples/branches/2.0/migration-servlets/build.properties URL: http://svn.apache.org/viewvc/geronimo/samples/branches/2.0/migration-servlets/build.properties?rev=647303&view=auto ============================================================================== --- geronimo/samples/branches/2.0/migration-servlets/build.properties (added) +++ geronimo/samples/branches/2.0/migration-servlets/build.properties Fri Apr 11 13:48:31 2008 @@ -0,0 +1,26 @@ +# 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. + +#Replace java.home with your jdk directory +java.home=C:/Program Files/Java/jdk1.5.0_11 + +#Replace j2ee.home with the parent directory of lib/j2ee.jar +j2ee.home=C:/jboss-4.2.1.GA/server/default + +#Replace with jboss home directory +jboss.server=C:/jboss-4.2.1.GA/server/default + +#geronimo home +geronimo.home=C:/geronimo-jetty6-jee5-2.0.1 Propchange: geronimo/samples/branches/2.0/migration-servlets/build.properties ------------------------------------------------------------------------------ svn:eol-style = native Propchange: geronimo/samples/branches/2.0/migration-servlets/build.properties ------------------------------------------------------------------------------ svn:keywords = Date Revision Propchange: geronimo/samples/branches/2.0/migration-servlets/build.properties ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: geronimo/samples/branches/2.0/migration-servlets/build.xml URL: http://svn.apache.org/viewvc/geronimo/samples/branches/2.0/migration-servlets/build.xml?rev=647303&view=auto ============================================================================== --- geronimo/samples/branches/2.0/migration-servlets/build.xml (added) +++ geronimo/samples/branches/2.0/migration-servlets/build.xml Fri Apr 11 13:48:31 2008 @@ -0,0 +1,52 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Propchange: geronimo/samples/branches/2.0/migration-servlets/build.xml ------------------------------------------------------------------------------ svn:eol-style = native Propchange: geronimo/samples/branches/2.0/migration-servlets/build.xml ------------------------------------------------------------------------------ svn:keywords = Date Revision Propchange: geronimo/samples/branches/2.0/migration-servlets/build.xml ------------------------------------------------------------------------------ svn:mime-type = text/xml Added: geronimo/samples/branches/2.0/migration-servlets/jboss-build.xml URL: http://svn.apache.org/viewvc/geronimo/samples/branches/2.0/migration-servlets/jboss-build.xml?rev=647303&view=auto ============================================================================== --- geronimo/samples/branches/2.0/migration-servlets/jboss-build.xml (added) +++ geronimo/samples/branches/2.0/migration-servlets/jboss-build.xml Fri Apr 11 13:48:31 2008 @@ -0,0 +1,54 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Propchange: geronimo/samples/branches/2.0/migration-servlets/jboss-build.xml ------------------------------------------------------------------------------ svn:eol-style = native Propchange: geronimo/samples/branches/2.0/migration-servlets/jboss-build.xml ------------------------------------------------------------------------------ svn:keywords = Date Revision Propchange: geronimo/samples/branches/2.0/migration-servlets/jboss-build.xml ------------------------------------------------------------------------------ svn:mime-type = text/xml