Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Random Text

 
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: 18423
60
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
 
No prison can hold Chairface Chippendale. And on a totally different topic ... my stuff:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!