incubator-stonehenge-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From shan...@apache.org
Subject svn commit: r772073 - in /incubator/stonehenge/trunk/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 06:56:24 GMT
Author: shankar
Date: Wed May  6 06:56:24 2009
New Revision: 772073

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

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

Modified: incubator/stonehenge/trunk/stocktrader/php/business_service/business_processor.php
URL: http://svn.apache.org/viewvc/incubator/stonehenge/trunk/stocktrader/php/business_service/business_processor.php?rev=772073&r1=772072&r2=772073&view=diff
==============================================================================
--- incubator/stonehenge/trunk/stocktrader/php/business_service/business_processor.php (original)
+++ incubator/stonehenge/trunk/stocktrader/php/business_service/business_processor.php Wed
May  6 06:56:24 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();

Modified: incubator/stonehenge/trunk/stocktrader/wsas/common/src/org/apache/stonehenge/stocktrader/mysql/MySQLMarketSummaryDAO.java
URL: http://svn.apache.org/viewvc/incubator/stonehenge/trunk/stocktrader/wsas/common/src/org/apache/stonehenge/stocktrader/mysql/MySQLMarketSummaryDAO.java?rev=772073&r1=772072&r2=772073&view=diff
==============================================================================
--- incubator/stonehenge/trunk/stocktrader/wsas/common/src/org/apache/stonehenge/stocktrader/mysql/MySQLMarketSummaryDAO.java
(original)
+++ incubator/stonehenge/trunk/stocktrader/wsas/common/src/org/apache/stonehenge/stocktrader/mysql/MySQLMarketSummaryDAO.java
Wed May  6 06:56:24 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/trunk/stocktrader/wsas/resources/conf/db.properties
URL: http://svn.apache.org/viewvc/incubator/stonehenge/trunk/stocktrader/wsas/resources/conf/db.properties?rev=772073&r1=772072&r2=772073&view=diff
==============================================================================
--- incubator/stonehenge/trunk/stocktrader/wsas/resources/conf/db.properties (original)
+++ incubator/stonehenge/trunk/stocktrader/wsas/resources/conf/db.properties Wed May  6 06:56:24
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