• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

to store text as VARCHAR or CLOB?

 
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi ,
wanted to know lets which is better approach
to save text which could be upto 1000 characters as Varchar(1000) or using CLOB ?

like in javaranch are these posts saved as files in the database or as charcter oriented field?

-Thanks.
 
author & internet detective
Posts: 41860
908
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Prakash,
What do you need to do with the data? In particular, if you want to search it using "like", varchar is better.

JavaRanch stores everything in files. It doesn't use a database.
 
prakash chauhan
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks..
I was trying to create a sort of BLOG , and was wondering how to tackle it.
Should i be creating a database with files (using clob) or should i save the posts as VARCHAR?
Blogs seems to be pretty complex things to implement so thats why confused.
-Thanks.
 
Ranch Hand
Posts: 338
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by prakash chauhan:
Thanks..
I was trying to create a sort of BLOG , and was wondering how to tackle it.
Should i be creating a database with files (using clob) or should i save the posts as VARCHAR?
Blogs seems to be pretty complex things to implement so thats why confused.
-Thanks.



You should think about how you want to organize the data first and how it will relate to each other before you worry about data types. At the moment you seem to be making an assumption that there is one column entry per blog... it doesn't necessarily have to be that way.
 
prakash chauhan
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
well i have the ideas in my mind ,,
what i have thought i would go about it is like this..
I ll be needing three tables ,
one for users , one for quetions posted and one for answers.
each question posted will be saved in the questions table (primary key=QuestionID)and will have a user id to indicate who posted it ..
every answer will be a row in a table will be linked with its corressponding question by its QuestionID and again user who posted it.

now i can have queries to pull up answers to a questions or number of replies to a question and all that ..

now i came to know that javaracnch uses file and no database as such so how can we use files to save blog data without using a database?

Ideas i m having i know are blurry but thats possibly because i am still new and thats why just think of Jumping to Coding and try to bypass design consideration and all that..

-thanks.
 
reply
    Bookmark Topic Watch Topic
  • New Topic