title: Data truncation: Data too long for column 'logo' at row 1
body: <p>I am trying to insert a photo into a BLOB column of a MySQL table, and I get an exception:</p>
  
  <pre><code>Data too long for column 'logo' at row 1. 
  </code></pre>
  
  <p>Here is the JDBC:</p>
  
  <pre><code>    int idRestaurant = 42;
      String restoname=  "test";
      String restostatus=  "test";
      InputStream fileContent = getUploadedFile();
      int fileSize = getUploadedFileSize();
  
      Class.forName("com.mysql.jdbc.Driver");
      try (Connection conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/resto" , "root" , "" )) {
          PreparedStatement ps = conn.prepareStatement("insert into restaurants (idRestaurant, restaurantName, status, logo) values(?,?,?,?)");
          ps.setInt(1, idRestaurant);
          ps.setString(2, restoname);
          ps.setString(3, restostatus);
          ps.setBinaryStream(4, fileContent, fileSize);
          ps.executeUpdate();
          conn.commit();
      }
  </code></pre>
  
  <p>How do I solve this problem?</p>