public void logOnAS(String text){
if(!this.ASConnected()) this.ASConnect();
String host = "";
java.net.InetAddress localMachine = null;
try {
localMachine = java.net.InetAddress.getLocalHost();
} catch (UnknownHostException e) {
e.printStackTrace();
}
host = localMachine.getHostName();
if(text.length()>255)
text = text.substring(0,255);
String data = new SimpleDateFormat("yyyyMMdd").format(new GregorianCalendar().getTime());
String ora = new SimpleDateFormat("HHmmss").format(new GregorianCalendar().getTime());
String sql = "" +
"INSERT INTO test.log (loannu, locomm, lodata, looral, lohost, lotext)" +
"VALUES('', 'C037', "+ data + ", " + ora + ", '" + host + "', '" + text + "')";
try{
Statement st = this.connection.createStatement();
st.executeUpdate(sql);
st.close();
}catch(SQLException e){
e.printStackTrace();
}
}