How to store java application metrics in shared database -
i have school project @ have created cpu benchmark. project made in java in eclipse.
i want every time run project result benchmark gives written in online database can see. (it id: x , cpu_score: y)
the point benchmark run many users , want have results of them. can recommend me tool use database?
i have tried using derby have encountered problems , not sure derby solution need
for connection use this...
private connection connecttodb() { final string dbhost = "url"; try { string dbconnect = "jdbc:informix-sqli://" + dbhost + ":port/databasename"; class.forname("com.informix.jdbc.ifxdriver").newinstance(); return drivermanager.getconnection(dbconnect, "user", "passwort"); } catch (throwable e) { return null; } return null; }
to values this...
public void getdbcontent(connection conn) { final string str = "select columnname,columnname2,columnname3 tablename"; try { preparedstatement sqlstatement = conn.preparestatement(str.tostring()); resultset rs = sqlstatement.executequery(); while (rs.next()) { system.out.println(rs.getstring("columnname")); system.out.println(rs.getstring("columnname2")); system.out.println(rs.getstring("columnname3")); } } catch (throwable e) { } }
Comments
Post a Comment