Store Strings longer than 255 in a database in Netbeans

973 Views Asked by At

I have a problem with my database. It's a database that you can create with Netbeans. I want to insert a string that is longer than 255 characters. I have seen that you can say varchar(512). But I generate my tables with the @Entity-Annotation and attributes in my class.

How can I put longer strings into the database?

I am using Netbeans 8.0.2.

1

There are 1 best solutions below

2
On BEST ANSWER

In your entity classes use the @Column annotation for the fields you want and specify columnDefinition="VARCHAR(512)".