i am making a chatting software in java in which the chats are to be stored in the database but how the chats of different size can be stored in it.
Asked
Active
Viewed 671 times
1
-
Please read [this post](https://stackoverflow.com/questions/6766781/maximum-length-for-mysql-type-text) – Juan Carlos Mendoza Sep 26 '17 at 14:03
-
thx. for your help – Gurmeet singh Sep 26 '17 at 14:11
2 Answers
1
I would suggest you to use text file locally for saving chat histories and sync that text file in database in BLOB field. using stream writers you can easily retrieve through saved data.
Best luck, Happy coding

Sanjeet Kumar
- 26
- 1
0
there are many types that can store a large amount of data like
TINYTEXT 256 bytes
TEXT 65,535 bytes ~64kb
MEDIUMTEXT 16,777,215 bytes ~16MB
LONGTEXT 4,294,967,295 bytes ~4GB
or you can use BLOB to store data as file ,i hope this example will help Insert file data into MySQL database using JDBC example

wafaa hegazy
- 97
- 6
-
but this will take lots of the space even if the size of the text is not so long – Gurmeet singh Sep 26 '17 at 14:18
-