title: Inserting array data into database on play framework anorm
body: <p>I need to store array data into database. But I don't find samples how to do that. I tried just treating array as a normal data type but it seems it doesn't work. Here is my code: </p>
  
  <p>In the database table, I have 3 columns:  </p>
  
  <pre><code>Id integer,
  uLocation integer,
  Prices integer(366)
  </code></pre>
  
  <p>In SQL, insert, update or query the table by using: </p>
  
  <pre><code>def InseartToDatabase(ItemPrices: ListBuffer[Int], Id: Int, uLocation: Int) = {
       val prices = ItemPrices.toArray
       DB.withConnection { implicit c =&gt;
           SQL("insert into task (Id, uLocation, Prices) values ({Id},{uLocation}, {Prices})").on('Id -&gt;Id, 'uLocation-&gt;uLocation, 'Prices -&gt; Prices).executeUpdate()
       }
  }
  </code></pre>
  
  <p>This doesn't work just silently and no exception reported. But next update just failed. If I remove the array fields, above code just works fine.  </p>
  
  <p>Also, I have no idea how to query it. </p>