// OLD! no longer used! 06.06.2011 package Parse; import java.io.BufferedWriter; import java.io.File; import java.io.FileWriter; import java.io.IOException; import java.sql.Connection; import java.sql.DriverManager; import java.sql.SQLException; import java.sql.Timestamp; import DataStructure.SingleBTS; public class CalcVariance { static SingleBTS[] btsarray; public static void Calc(sqlreader sql, Timestamp start, Timestamp end, int ARFCN, int place) throws ClassNotFoundException, SQLException, IOException { btsarray = sql.btsarray; // create output File File outputUL = new File("varianz/Ort " + place + " UL-" + sql.IMSI + ".txt"); File outputDL = new File("varianz/Ort " + place + " DL-" + sql.IMSI + ".txt"); FileWriter streamUL = new FileWriter(outputUL); FileWriter streamDL = new FileWriter(outputDL); BufferedWriter UL = new BufferedWriter(streamUL); BufferedWriter DL = new BufferedWriter(streamDL); for (SingleBTS current : btsarray) { if (current.time.getTime() >= start.getTime() && current.time.getTime() <= end.getTime() && current.ARFCN == ARFCN) { if (current.getUldB() != 0) UL.write((int) current.getUldB() + ";"); if (current.getDldB() != 0) DL.write((int) current.getDldB() + ";"); } } UL.close(); DL.close(); streamUL.close(); streamDL.close(); Class.forName("com.mysql.jdbc.Driver"); // open connection Connection cn = DriverManager.getConnection( "jdbc:mysql://132.230.4.13:3306/logging", "richard", "uh237Aug.ad7"); cn.setReadOnly(true); System.out.println("Connected to SQL"); // prepare a statement to the connection cn // Statement st_MR = cn.createStatement(); // Timestamp start = new Timestamp(2011, 04, 05, 13, 42, 28, 0); // Timestamp end = new Timestamp(2011, 04, 05, 13, 42, 28, 0); } }