I am trying to write an array to mysql database, however this seems to put the cpu to 100% usage.
public void add_data(double[] data) throws SQLException {
PreparedStatement c = null;
String sql = "INSERT INTO lowpassdata(data) VALUES(?)";
c = this.conn.prepareStatement(sql);
for(int i=0; i<data.length; i++) {
c.setDouble(1, data[i]);
c.executeUpdate();
}
c.close();
}