• 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
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

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: 40747
827
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: 67590
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
 
So there I was, trapped in the jungle. And at the last minute, I was saved by this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic