incubator-stonehenge-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From shan...@apache.org
Subject svn commit: r772075 - in /incubator/stonehenge/branches/m1/stocktrader: php/business_service/business_processor.php wsas/common/src/org/apache/stonehenge/stocktrader/mysql/MySQLMarketSummaryDAO.java wsas/resources/conf/db.properties
Date Wed, 06 May 2009 07:01:37 GMT
Author: shankar
Date: Wed May  6 07:01:37 2009
New Revision: 772075

URL: http://svn.apache.org/viewvc?rev=772075&view=rev
Log:
fixing MSSQL specific queries

Modified:
    incubator/stonehenge/branches/m1/stocktrader/php/business_service/business_processor.php
    incubator/stonehenge/branches/m1/stocktrader/wsas/common/src/org/apache/stonehenge/stocktrader/mysql/MySQLMarketSummaryDAO.java
    incubator/stonehenge/branches/m1/stocktrader/wsas/resources/conf/db.properties

Modified: incubator/stonehenge/branches/m1/stocktrader/php/business_service/business_processor.php
URL: http://svn.apache.org/viewvc/incubator/stonehenge/branches/m1/stocktrader/php/business_service/business_processor.php?rev=772075&r1=772074&r2=772075&view=diff
==============================================================================
--- incubator/stonehenge/branches/m1/stocktrader/php/business_service/business_processor.php
(original)
+++ incubator/stonehenge/branches/m1/stocktrader/php/business_service/business_processor.php
Wed May  6 07:01:37 2009
@@ -637,17 +637,17 @@
 	if($db)
 	{
 		$queryTSIA = "SELECT SUM(price)/COUNT(*) AS 
-				tsia FROM quote WHERE symbol like 's:1__'";
+				tsia FROM quote WHERE symbol like 's:%'";
 		$queryOPENTSIA = "SELECT SUM(open1)/COUNT(*) AS 
-				openTSIA FROM quote WHERE symbol LIKE 's:1__'";
+				openTSIA FROM quote WHERE symbol LIKE 's:%'";
 		$queryVolume = "SELECT SUM(volume) FROM quote 
-				WHERE symbol LIKE 's:1__'";
+				WHERE symbol LIKE 's:%'";
 		$queryGainers = "SELECT symbol, companyname, volume, price, 
 				open1, low, high, change1 FROM quote WHERE symbol 
-				LIKE 's:1__' ORDER BY change1 DESC";
+				LIKE 's:%' ORDER BY change1 DESC";
 		$queryLosers = "SELECT symbol, companyname, volume, price, 
 				open1, low, high, change1 FROM quote WHERE symbol 
-				LIKE 's:1__' ORDER BY change1";
+				LIKE 's:%' ORDER BY change1";
 		
 		$response = new getMarketSummaryResponse();
 		$response->getMarketSummaryReturn = new MarketSummaryDataBeanWS();
@@ -689,19 +689,19 @@
 				$response->getMarketSummaryReturn->topGainers->
 					QuoteDataBean[$rawNo]->symbol = $symbol;
 				$response->getMarketSummaryReturn->topGainers->
-					QuoteDataBean[$rawNo]->companyName = $db->GetSQLValue($result, 0, 1);
+					QuoteDataBean[$rawNo]->companyName = $db->GetSQLValue($result, $rawNo, 1);
 				$response->getMarketSummaryReturn->topGainers->
-					QuoteDataBean[$rawNo]->volume = $db->GetSQLValue($result, 0, 2);
+					QuoteDataBean[$rawNo]->volume = $db->GetSQLValue($result, $rawNo, 2);
 				$response->getMarketSummaryReturn->topGainers->
-					QuoteDataBean[$rawNo]->price = $db->GetSQLValue($result, 0, 3);
+					QuoteDataBean[$rawNo]->price = $db->GetSQLValue($result, $rawNo, 3);
 				$response->getMarketSummaryReturn->topGainers->
-					QuoteDataBean[$rawNo]->open = $db->GetSQLValue($result, 0, 4);
+					QuoteDataBean[$rawNo]->open = $db->GetSQLValue($result, $rawNo, 4);
 				$response->getMarketSummaryReturn->topGainers->
-					QuoteDataBean[$rawNo]->low = $db->GetSQLValue($result, 0, 5);
+					QuoteDataBean[$rawNo]->low = $db->GetSQLValue($result, $rawNo, 5);
 				$response->getMarketSummaryReturn->topGainers->
-					QuoteDataBean[$rawNo]->high = $db->GetSQLValue($result, 0, 6);
+					QuoteDataBean[$rawNo]->high = $db->GetSQLValue($result, $rawNo, 6);
 				$response->getMarketSummaryReturn->topGainers->
-					QuoteDataBean[$rawNo]->change = $db->GetSQLValue($result, 0, 7);
+					QuoteDataBean[$rawNo]->change = $db->GetSQLValue($result, $rawNo, 7);
 				$rawNo = $rawNo + 1;
 			}
 			$result = null;
@@ -720,19 +720,19 @@
 				$response->getMarketSummaryReturn->topLosers->
 					QuoteDataBean[$rawNo]->symbol = $symbol;
 				$response->getMarketSummaryReturn->topLosers->
-					QuoteDataBean[$rawNo]->companyName = $db->GetSQLValue($result, 0, 1);
+					QuoteDataBean[$rawNo]->companyName = $db->GetSQLValue($result, $rawNo, 1);
 				$response->getMarketSummaryReturn->topLosers->
-					QuoteDataBean[$rawNo]->volume = $db->GetSQLValue($result, 0, 2);
+					QuoteDataBean[$rawNo]->volume = $db->GetSQLValue($result, $rawNo, 2);
 				$response->getMarketSummaryReturn->topLosers->
-					QuoteDataBean[$rawNo]->price = $db->GetSQLValue($result, 0, 3);
+					QuoteDataBean[$rawNo]->price = $db->GetSQLValue($result, $rawNo, 3);
 				$response->getMarketSummaryReturn->topLosers->
-					QuoteDataBean[$rawNo]->open = $db->GetSQLValue($result, 0, 4);
+					QuoteDataBean[$rawNo]->open = $db->GetSQLValue($result, $rawNo, 4);
 				$response->getMarketSummaryReturn->topLosers->
-					QuoteDataBean[$rawNo]->low = $db->GetSQLValue($result, 0, 5);
+					QuoteDataBean[$rawNo]->low = $db->GetSQLValue($result, $rawNo, 5);
 				$response->getMarketSummaryReturn->topLosers->
-					QuoteDataBean[$rawNo]->high = $db->GetSQLValue($result, 0, 6);
+					QuoteDataBean[$rawNo]->high = $db->GetSQLValue($result, $rawNo, 6);
 				$response->getMarketSummaryReturn->topLosers->
-					QuoteDataBean[$rawNo]->change = $db->GetSQLValue($result, 0, 7);
+					QuoteDataBean[$rawNo]->change = $db->GetSQLValue($result, $rawNo, 7);
 				$rawNo = $rawNo + 1;
 			}
 			$result = null;

Modified: incubator/stonehenge/branches/m1/stocktrader/wsas/common/src/org/apache/stonehenge/stocktrader/mysql/MySQLMarketSummaryDAO.java
URL: http://svn.apache.org/viewvc/incubator/stonehenge/branches/m1/stocktrader/wsas/common/src/org/apache/stonehenge/stocktrader/mysql/MySQLMarketSummaryDAO.java?rev=772075&r1=772074&r2=772075&view=diff
==============================================================================
--- incubator/stonehenge/branches/m1/stocktrader/wsas/common/src/org/apache/stonehenge/stocktrader/mysql/MySQLMarketSummaryDAO.java
(original)
+++ incubator/stonehenge/branches/m1/stocktrader/wsas/common/src/org/apache/stonehenge/stocktrader/mysql/MySQLMarketSummaryDAO.java
Wed May  6 07:01:37 2009
@@ -41,11 +41,11 @@
 	private static final String SQL_SELECT_QUOTE_NOLOCK = "SELECT symbol, companyname, volume,
price, open1, low, high, change1 FROM quote WHERE symbol = ?";
 	private static final String SQL_UPDATE_STOCKPRICEVOLUME = "UPDATE quote SET price = ?, low
= ?, high = ?, change1 = ? - open1, volume = volume + ? WHERE symbol = ?";
 
-	private static final String SQL_SELECT_MARKETSUMMARY_GAINERS = "SELECT symbol, companyname,
volume, price, open1, low, high, change1 FROM quote WHERE symbol LIKE 's:1__' ORDER BY change1
DESC";
-	private static final String SQL_SELECT_MARKETSUMMARY_LOSERS = "SELECT symbol, companyname,
volume, price, open1, low, high, change1 FROM quote WHERE symbol LIKE 's:1__' ORDER BY change1";
-	private static final String SQL_SELECT_MARKETSUMMARY_TSIA = "SELECT SUM(price) / COUNT(*)
as tsia FROM quote WHERE symbol LIKE 's:1%'";
-	private static final String SQL_SELECT_MARKETSUMMARY_OPENTSIA = "SELECT SUM(open1) / COUNT(*)
as opentsia FROM quote WHERE symbol LIKE 's:1%'";
-	private static final String SQL_SELECT_MARKETSUMMARY_VOLUME = "SELECT SUM(volume) FROM quote
WHERE symbol LIKE 's:1%'";
+	private static final String SQL_SELECT_MARKETSUMMARY_GAINERS = "SELECT symbol, companyname,
volume, price, open1, low, high, change1 FROM quote WHERE symbol LIKE 's:%' ORDER BY change1
DESC";
+	private static final String SQL_SELECT_MARKETSUMMARY_LOSERS = "SELECT symbol, companyname,
volume, price, open1, low, high, change1 FROM quote WHERE symbol LIKE 's:%' ORDER BY change1";
+	private static final String SQL_SELECT_MARKETSUMMARY_TSIA = "SELECT SUM(price) / COUNT(*)
as tsia FROM quote WHERE symbol LIKE 's:%'";
+	private static final String SQL_SELECT_MARKETSUMMARY_OPENTSIA = "SELECT SUM(open1) / COUNT(*)
as opentsia FROM quote WHERE symbol LIKE 's:%'";
+	private static final String SQL_SELECT_MARKETSUMMARY_VOLUME = "SELECT SUM(volume) FROM quote
WHERE symbol LIKE 's:%'";
 
 	public MySQLMarketSummaryDAO(Connection sqlConnection) throws DAOException {
 		super(sqlConnection);

Modified: incubator/stonehenge/branches/m1/stocktrader/wsas/resources/conf/db.properties
URL: http://svn.apache.org/viewvc/incubator/stonehenge/branches/m1/stocktrader/wsas/resources/conf/db.properties?rev=772075&r1=772074&r2=772075&view=diff
==============================================================================
--- incubator/stonehenge/branches/m1/stocktrader/wsas/resources/conf/db.properties (original)
+++ incubator/stonehenge/branches/m1/stocktrader/wsas/resources/conf/db.properties Wed May
 6 07:01:37 2009
@@ -14,7 +14,7 @@
 # limitations under the License.
 org.apache.stonehenge.stocktrader.database.host=localhost
 org.apache.stonehenge.stocktrader.database.port=1433
-org.apache.stonehenge.stocktrader.database.db=StockTraderDB
+org.apache.stonehenge.stocktrader.database.db=stocktraderdb
 org.apache.stonehenge.stocktrader.database.user=trade
 org.apache.stonehenge.stocktrader.database.password=yyy
 org.apache.stonehenge.stocktrader.database.type=mssql



Mime
View raw message