Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Simplest way to execute a DB query in a JSP

 
Renato Losio
Ranch Hand
Posts: 99
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys,

what's the simplest way to retrieve a count(*) from a DB table in a brand new jsp page?

I need just a very temp page for a few days and I don't really plan to change the DAO design or integrate the new page in the web app. So simply a 'plug & play' page using the Postgres connection JBoss has or even opening a new connection.

I would then take care of the security of the page in the web.xml

Suggestions? Pitfalls?

Cheers,

Renato
 
Adeel Ansari
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JSTL SQL Tag is your best bet.
 
Renato Losio
Ranch Hand
Posts: 99
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks, done. Now, what's the best bet if I like to move the db connection string to a properties file? Using init-param in the web.xml? Something else I can keep separated of the current web app config files?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic