lundi 26 janvier 2015

SQLite and Java to Store URLs

I have created a database using SQLite connected with the Java programming language.


The purpose of this database is to store a URL. I have created this and works for small urls. Big urls like a youtube video can't be store, I mean that the URL is cut at the end, missing 3 or 4 characters.


Here is my field structure:



URL VARCHAR NOT NULL


I have use the VARCHAR data type as it can store 255 characters. Unfortunately a long URL can't be store. How can I deal with this problem? Even a youtube URL is "small" for me, in sense that I assume that the user may store even longer one like a product in amazon where the URL is much larger than the youtube one.


Edit I tried to enter the long URL manually to SQLite and the URL can be stored, so the problem is with the Java data type -> String.


Thanks.


Aucun commentaire:

Enregistrer un commentaire