title: Inserting and reading a string array in Java
body: <p>I'm using prepared statements to insert an array into my database</p>
  
  <pre><code>PreparedStatement pstmt = conn.prepareStatement("INSERT INTO TABLE(stringArray) VALUES (?)");
  String[] arr = { "a", " b", "c" };
  pstmt.setObject(1, arr);
  </code></pre>
  
  <p>I'm using setObject following an example, but setArray won't resolve and setBlob doesnt work either.</p>
  
  <p>Now when i come to read it, I'm not sure what to do with my object to get the array values back!</p>
  
  <pre><code>PreparedStatement pstmt = conn.prepareStatement("SELECT stringArray FROM TABLE WHERE id = 1");
  ResultSet rs = pstmt.executeQuery();
  rs.next();
  Object object = rs.getObject(1);
  System.out.println(object.toString());
  </code></pre>
  
  <p>Just outputs </p>
  
  <pre><code>[B@45d0e784
  </code></pre>
  
  <p>I know i'm doing object.toString and i want an array, but how would i do that? do i need to set it as a byte or something when inserting?</p>
  
  <p>Thanks for your help</p>