• Post Reply Bookmark Topic Watch Topic
  • New Topic

Random Text  RSS feed

 
Roy Abu Bakar
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

How to select a random text from database, i am using seam framework and hibernate.
I want to display a Random Quote like in this site: http://www.shultz-project.com/web-development/homepage.jsf

Thanks.
 
Tim Holloway
Bartender
Posts: 18715
71
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There's really not anything JSF-related to that. Just write up something that fetches a random row from the database. How you do that will depend on how the database is organized.
 
Viswanath Tg
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It will be good to use the .properties file rather than Data Base
For example in properties file declare some quotes
1=quote1
2=quote2
3=quote3

load the properties file generate a random number and pass the random number to get the corresponding quote....
In the same way you can pass the random number to the Data Base to get the corresponding quote
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!