File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and Relational Databases and the fly likes infinite positions for column Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "infinite positions for column" Watch "infinite positions for column" New topic

infinite positions for column

Candy Bortniker
Ranch Hand

Joined: Mar 17, 2003
Posts: 123
I have a textfield that is a scrollpane that allows for a description to be entered, this could have an infinite amount of characters. How would I set that up when I create the table to allow for any amount of characters? Or can I do that?
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15302

Depends on the Database you are using. MySQL has a TEXT data type. It will probably be what you want to use. There are constraints on any data type in any database. Even if it just comes down to the allowed memory size of the table itself. Here is a list of data types and their storage limitations for MySQL. If you aren't using MySQL let me know and I will try and located info on your DB.

GenRocket - Experts at Building Test Data
Adrian Yan
Ranch Hand

Joined: Oct 02, 2000
Posts: 688
Actually, Candy, you need to set your requirement a little better. Your requirement should'nt say infinite, because the obviously no-one is gonna type in infinite amount of characters. You should set the description to whatever your database allow, and in your appliaction, check for the number of characters and give the user indication of amount allow.
I agree. Here's the link:
subject: infinite positions for column
It's not a secret anymore!