Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package Main;
- import java.io.IOException;
- import java.util.Arrays;
- import java.util.List;
- public class RunChunk {
- /*
- * Download the CSV once
- * Parse through to fill a List
- * Iterate through list saving variables each time
- * Run SQL query with saved variables each iteration
- */
- static String symbol;
- static String askPrice;
- static String bidPrice;
- static String realPrice;
- static String volume;
- static String dividendYield;
- public static void main(String [] args) throws IOException {
- String[] sqlString;
- String splitBy = ",";
- GetFile.GetFileMakeFolder();
- ParseAndIterate.IterateCSV();
- SQLQuery query = new SQLQuery();
- List<String> sl = ParseAndIterate.stockInfo;
- while( ! sl.isEmpty() ) {
- String element = sl.get(0);
- sl= sl.subList(1,sl.size());
- System.out.println("Stock Info: " + element);
- sqlString = element.split(splitBy);
- String sql = Arrays.toString(sqlString);
- symbol = sqlString[0];
- askPrice = sqlString[1];
- bidPrice = sqlString[2];
- realPrice = sqlString[3];
- volume = sqlString[4];
- dividendYield = sqlString[5];
- System.out.println("Split String: " + sql);
- System.out.println("Stock: " + symbol + askPrice + bidPrice + realPrice + volume + dividendYield);
- System.out.println("");
- query.SendQuery();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement