• 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:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

Storing input labels in database

 
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

I have one issue :

I have a form say for login and I have two fields login id and password. Now what I want is to save the labels attached to these fields in database. Can anyone help me regarding this how to fetch the associated lables from database.

I want some thing like below:

Example:

 
author & internet detective
Posts: 42135
937
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
Ankit,
Most people store these in a property file rather than a database.

If you do want to use a database, have you read anything about JDBC yet?
 
Sheriff
Posts: 67754
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
As Jeanne mentioned, I'd use a properties file, and the <fmt:message> tag, like 99.999999% of everyone else out there.

If you insist on using a database (why?), I'd fetch the values in the page controller to pass to the JSP as a Map and use the EL from there. But I'd only do that if I had a really, really, really, really good reason to use a database over the more conventional properties files.
 
Ankit Mishra
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Thank you both of you for the resolution. I was thinking about the database, so that if I have to make any change I can directly change in the database. But there will be an additional overhead of data fetching.
Yes Jeanne I am aware of JDBC.

I was unaware of <fmt:message> tag. Thank you both of you for guidance
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic