title: "data exception: string data, right truncation" on INSERT with prepared statement
body: <p>When attempting to execute a preparedStatement with parameters in this code</p>
  
  <pre><code>public void Insert(String TreeType, String LastWatered, String PlantDate) {
      try {
          String G = "INSERT INTO Trees (TreeType, LastWatered, PlantDate) VALUES 
  (?, ?, ?)";
          PreparedStatement preparedStatement = conn.prepareStatement(G);
          preparedStatement.setString(1, TreeType);
          preparedStatement.setString(2, LastWatered);
          preparedStatement.setString(3, PlantDate);
          preparedStatement.executeUpdate();
      } catch (SQLException ex) {
          Logger.getLogger(TreeArr.class.getName()).log(Level.SEVERE, null, ex);
      }
  
  }
  </code></pre>
  
  <p>I get this error</p>
  
  <pre><code>    Sep 09, 2018 2:15:51 AM pat.ConnectDb Insert
      SEVERE: null
      net.ucanaccess.jdbc.UcanaccessSQLException: UCAExc:::4.0.4 data exception: 
      string data, right truncation;  table: TREES column: TREETYPE
      at 
  net.ucanaccess.jdbc.UcanaccessPreparedStatement.executeUpdate(UcanaccessPreparedStatement.java:269)
      at pat.ConnectDb.Insert(ConnectDb.java:41)
      at pat.AddTreeGUI.GoButton1ActionPerformed(AddTreeGUI.java:218)
      at pat.AddTreeGUI.access$100(AddTreeGUI.java:13)
      at pat.AddTreeGUI$2.actionPerformed(AddTreeGUI.java:67)
      at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022)
       ...
  Caused by: org.hsqldb.HsqlException: data exception: string data, right truncation;  table: TREES column: TREETYPE
      at org.hsqldb.error.Error.error(Unknown Source)
      at org.hsqldb.Table.enforceTypeLimits(Unknown Source)
      at org.hsqldb.Table.insertSingleRow(Unknown Source)
      at org.hsqldb.StatementDML.insertSingleRow(Unknown Source)
      at org.hsqldb.StatementInsert.getResult(Unknown Source)
      at org.hsqldb.StatementDMQL.execute(Unknown Source)
      at org.hsqldb.Session.executeCompiledStatement(Unknown Source)
      at org.hsqldb.Session.execute(Unknown Source)
      ... 46 more
  Caused by: org.hsqldb.HsqlException: data exception: string data, right truncation
      at org.hsqldb.error.Error.error(Unknown Source)
      at org.hsqldb.error.Error.error(Unknown Source)
      at org.hsqldb.types.CharacterType.convertToTypeLimits(Unknown Source)
      ... 53 more
  </code></pre>
  
  <p>however, it works when I input a real string eg</p>
  
  <pre><code>preparedStatement.setString(1, "Hello World");
  </code></pre>
  
  <p>How can this be done be acheved?</p>