Issue
I got error:
Data truncation: Data too long for column 'profile' at row 1
My stored variable photo down here:
alt="img of variable store in database" />
my entity code down here:
Entity:
@Entity
@Table(name = "profile_master")
public class profileEntity {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private int p_id;
private String profile;
private String website;
private String bio;
private String gender;
// getter setter
}
Solution
In the entity definition you can explicitly mention the column length as follows,
@Column(length = 2000)
or you can change the column type to text which can hold up to 65,535 bytes.
@Column(columnDefinition="TEXT")
Answered By - ray
Answer Checked By - Pedro (JavaFixing Volunteer)