public void write(int id, DepthTableData dt) {
    if (conn == null)
      return;
    
    //HACK
    Statement stmt = null;

    try {
      stmt = conn.createStatement();
      
      // Date
      SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
      formatter.setTimeZone(TimeZone.getTimeZone("UTC"));
      String dateString = formatter.format(new Date());
      
      // BUILD INSERT HERE
      int contractID = id - ContractData.MKT_DEPTH;
    
      String sql = "INSERT INTO depths  (" +
        "contract_id," +
        "bid_price," +
        "bid_size," +
        "bid_vwap," +
        "bid_total_size," +
        "ask_price," +
        "ask_size," +
        "ask_vwap," +
        "ask_total_size," +
        "created_at," +                                          
        "updated_at) VALUES (" +                                         
        contractID + "," + // contract_id
        dt.bids[0].get("price") + "," + // bid_price
        dt.bids[0].get("size") + "," + // bid_size
        dt.bidVWAP() + "," + // bid_vwap
        dt.bidSizeSum() + "," + // bid_total_size
        dt.asks[0].get("price") + "," + // ask_price
        dt.asks[0].get("size") + "," + // ask_size
        dt.askVWAP() + "," + // ask_vwap
        dt.askSizeSum() + "," + // ask_total_size
        "\"" + dateString + "\"," + // created_at
        "\"" + dateString + "\");"; // updated_at                                                                                  
                         
      stmt.executeUpdate(sql);
      //stmt.getUpdateCount(); // yields affected rows
      
      logger.info("Wrote to DB at: " + dateString + " id:" + id + " table:\n" + dt.toString());
    } catch (SQLException ex) {
      // handle any errors      
      logger.error(ex.getMessage());
    } finally {
      // it is a good idea to release
      // resources in a finally{} block
      // in reverse-order of their creation
      // if they are no-longer needed

      if (stmt != null) {
        try {
          stmt.close();
        } catch (SQLException sqlEx) { } // ignore

        stmt = null;
      }
    }
            
  }