Results 1 to 10 of 10
  1. #1
    UJJAL DHAR is offline Senior Member
    Join Date
    Apr 2010
    Location
    Dhaka,Bangladesh
    Posts
    180
    Rep Power
    0

    Default Please help me(Database)

    I have learned database a little.Using MySQL I can create own database of tables.But I want to store a .txt file or a paragraph in my database.How can I solved it?

    I have read about text datatype but I can't use that.
    Anyone please help me..
    Thanks in advance.

  2. #2
    StormyWaters is offline Senior Member
    Join Date
    Feb 2009
    Posts
    305
    Rep Power
    6

    Default

    Try using a Blob field. I currently use it for storing images in a MySQL database.

  3. #3
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,925
    Rep Power
    19

    Default

    And why are you asking this on a Java forum?

    That aside, why can't you use text? Large text is what it was designed for.
    Failing that, a VARCHAR(max) may be good enough, if you're 5+ and need fewer than 65k characters.

  4. #4
    JosAH's Avatar
    JosAH is online now Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,431
    Blog Entries
    7
    Rep Power
    20

    Default

    Quote Originally Posted by Tolls View Post
    And why are you asking this on a Java forum?

    That aside, why can't you use text? Large text is what it was designed for.
    Failing that, a VARCHAR(max) may be good enough, if you're 5+ and need fewer than 65k characters.
    Well, I am potty trained an I use Clobs for large texts (not Blobs)

    kind regards,

    Jos ;-)

  5. #5
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,925
    Rep Power
    19

    Default

    Does MySQL have CLOBs?
    I thought it was BLOBs and TEXT?

    ...oh and :p to the 5+ joke...:)

  6. #6
    JosAH's Avatar
    JosAH is online now Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,431
    Blog Entries
    7
    Rep Power
    20

    Default

    Quote Originally Posted by Tolls View Post
    Does MySQL have CLOBs?
    I thought it was BLOBs and TEXT?
    Yup, they call them TINYTEXT, TEXT, MEDIUMTEXT or LONGTEXT for reasons that are beyond me (don't you love those SQL standards?)

    kind regards,

    Jos

  7. #7
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,925
    Rep Power
    19

    Default

    Life would be too easy otherwise.

  8. #8
    UJJAL DHAR is offline Senior Member
    Join Date
    Apr 2010
    Location
    Dhaka,Bangladesh
    Posts
    180
    Rep Power
    0

    Default Actually

    Actually I want to know that What is the statement to create that text table in database?
    example:
    create table(mn varchar(100));


    For text what will be the statement?

  9. #9
    StormyWaters is offline Senior Member
    Join Date
    Feb 2009
    Posts
    305
    Rep Power
    6

  10. #10
    JosAH's Avatar
    JosAH is online now Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,431
    Blog Entries
    7
    Rep Power
    20

    Default

    Quote Originally Posted by UJJAL DHAR View Post
    Actually I want to know that What is the statement to create that text table in database?
    example:
    create table(mn varchar(100));


    For text what will be the statement?
    Strange, because in your OP you wrote this:

    Using MySQL I can create own database of tables.
    It doesn't take rocket science to change the type of one of the columns to clob, text or whatever ...

    kind regards,

    Jos

Similar Threads

  1. xml to database from xml rpc
    By kievari in forum JDBC
    Replies: 1
    Last Post: 12-11-2009, 12:14 AM
  2. Database Help
    By simtology in forum New To Java
    Replies: 3
    Last Post: 08-18-2009, 03:03 PM
  3. Database Help
    By simtology in forum New To Java
    Replies: 1
    Last Post: 08-17-2009, 06:14 PM
  4. What database shall i use?
    By etherkye in forum JDBC
    Replies: 13
    Last Post: 06-26-2009, 06:03 PM
  5. Replies: 2
    Last Post: 02-11-2009, 04:43 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •