Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Comments field size in Database colum

 
sohaib yasir
Ranch Hand
Posts: 51
Eclipse IDE Java MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I want to know technique that if i have a comments field on my blog and user will add comments more than 255 character or more than the column size in DB then how to dynamically set the comments filed size in Database column ?
 
Martin Vajsar
Sheriff
Posts: 3752
62
Chrome Netbeans IDE Oracle
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The maximum allowable length of a text column is probably database specific, but usually there is some hard limit (such as 4KB). If you want to use truly unlimited field for your text data, you should use a CLOB. In most databases there is still a limit on the maximum size of a CLOB, but it is usually high enough to be sufficient for virtually all purposes (that is, in the order of gigabytes, or even significantly larger).
 
sohaib yasir
Ranch Hand
Posts: 51
Eclipse IDE Java MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Martin. This will help me a lot.
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!