db
Class DataManager

java.lang.Object
  extended bydb.DataManager

public class DataManager
extends java.lang.Object

This class is used to upload data into the database tables.

from the files downloaded from the web using a web robot.


Field Summary
(package private)  java.lang.String sqlQuery
           
 
Constructor Summary
DataManager()
           
 
Method Summary
 void dataUpload()
          Uploads data downloaded by web robot to DB.
private static java.lang.String getTickerName(java.lang.String fileName)
          Extracts the ticker name from the file name.
 void processFile()
          Extracts data from file and inserts to database.
static java.util.ArrayList returnStockDataFromFile(java.lang.String filename)
          Returns data for a specific Stock ticker in a form suitable for insertion into a database by simply extracting each tuple from the returned ArrayList.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

sqlQuery

java.lang.String sqlQuery
Constructor Detail

DataManager

public DataManager()
Method Detail

dataUpload

public void dataUpload()
Uploads data downloaded by web robot to DB.

Forms SQL query for insert


processFile

public void processFile()
Extracts data from file and inserts to database.


returnStockDataFromFile

public static java.util.ArrayList returnStockDataFromFile(java.lang.String filename)
Returns data for a specific Stock ticker in a form suitable for insertion into a database by simply extracting each tuple from the returned ArrayList.

Every file must have the Yahoo format of "Date | Open | High | Low | Close | Volume | Adj. Close" and the last line of the file begins with "

getTickerName

private static java.lang.String getTickerName(java.lang.String fileName)
Extracts the ticker name from the file name.

Parameters:
fileName - The file name that contains the ticker name
Returns:
The actual ticker name who's data resides in the file, null if no ticker name is found