This commit is contained in:
2019-04-01 16:21:24 +02:00
parent 6c1f650295
commit baeaee5c4c

31
script/statistics.py Normal file
View File

@@ -0,0 +1,31 @@
import java.sql.DriverManager as DriverManager
import java.sql.ResultSet as ResultSet
import java.util.Properties as Properties
Class.forName("org.relique.jdbc.csv.CsvDriver");
db = "//Users//gobbo_a//dev//pshell//config//home//statistics"
props = Properties()
props.put("fileExtension", ".csv")
props.put("separator", ";")
#conn = DriverManager.getConnection("jdbc:relique:csv:" + db, props)
#stmt = conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_READ_ONLY)
#results = stmt.executeQuery("SELECT Command,Result FROM 2019_03");
props.put("indexedFiles", "true");
#props.put("fileTailPattern", "-(\\d+)_(\\d+)");
props.put("fileTailPattern", "(\\d+)_(\\d+)");
props.put("fileTailParts", "Year,Month");
conn = DriverManager.getConnection("jdbc:relique:csv:" + db, props);
stmt = conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_READ_ONLY);
#results = stmt.executeQuery("SELECT Command,Result,Year,Month FROM Test");
results = stmt.executeQuery("SELECT Command,Result,Year,Month FROM .");
if results.last():
print("Command= " + results.getString("Command") + " Result= " + results.getString("Result"))
if (results.first()):
print("Command= " + results.getString("Command") + " Result= " + results.getString("Result"))
conn.close()