hi every one, when I want store variable in Mysql using JDBC what type shoud I get for mediumtext and larg text? can i get String or must get Byte[]?
+1
A:
Java array indexes are integers, so you can have at most Integer.MAX_VALUE bytes in array which is 2^31-1 or one byte short of 2Gb.
String is the same deal as it's backed by character array (though the actual memory footprint of a maximum length String would be twice the above since Java stores them in Unicode).
MySQL's maximum size for MEDIUMTEXT is 16Mb, LONGTEXT is 4Gb. So the former would fit into both String and byte array while the latter won't fit in either. In practice, however, you'll hit many other problems before you get to that point :-) so you can use String for either medium or long text.
ChssPly76
2009-07-22 17:09:11
Tanx man for your complete Answer
Am1rr3zA
2009-07-22 18:05:22