summaryrefslogtreecommitdiffstats
path: root/Parse/CalcVariance.java
diff options
context:
space:
mode:
Diffstat (limited to 'Parse/CalcVariance.java')
-rw-r--r--Parse/CalcVariance.java65
1 files changed, 65 insertions, 0 deletions
diff --git a/Parse/CalcVariance.java b/Parse/CalcVariance.java
new file mode 100644
index 0000000..1aaccc9
--- /dev/null
+++ b/Parse/CalcVariance.java
@@ -0,0 +1,65 @@
+// 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);
+
+ }
+
+}