text: Hello,
  Are there components available for automating Calendar dropdowns and DBGrids
  with JSP?
  What is the best framework for multiuser ability with a database? We are
  considering and extra field that would increment when a user would open a
  record for editing. And, then deny updates if the number changes.
  Greg Critcher <gcritcher@nsi3.com> wrote:
  > Are there components available for automating Calendar dropdowns and DBGrids
  > with JSP?
  I don't know of any widely used ones. On the calendar front, if
  you're looking for something consisting of three dropdowns, one for
  day, month, and year, you could just have the dropdowns in html,
  as in:
  <select name="day">
  <option value="01">1
  <option value="02">2
  ...
  <select name="month">
  <option value="01">January
  <option value="02">February
  ...
  Then, to use these values, you'd just need a simple bean that would
  receive the values and convert them to a Date. Here's a basic
  version:
  import java.text.*;
  import java.util.Date;
  public class DateHandler {
  private DateFormat df = new SimpleDateFormat("MM/dd/yyyy");
  private String day;
  private String month;
  private String year;
  public void setDay(String day) {this.day = day;}
  public String getDay() {return day;}
  public void setMonth(String month) {this.month = month;}
  public String getMonth() {return month;}
  public void setYear(String year) {this.year = year;}
  public String getYear() {return month;}
  public Date getDate() {
  try {
  return df.parse(month + "/" + day + "/" + year);
  } catch (Exception e) {
  return new Date();
  }
  }
  public static void main(String argv[]) {
  DateHandler h = new DateHandler();
  h.setMonth(argv[0]);
  h.setDay(argv[1]);
  h.setYear(argv[2]);
  System.out.println(h.getDate());
  }
  }
  This uses Strings instead of integers for the day, month and year to
  make things easier for the DateFormatter to parse. Note that this
  will do weird things on invalid dates, like January 32, 2001.
  If you're looking for a fancier way to prompt for dates, there's a
  sample of a JSP example that displays a calendar view of the current
  month, available from. It should be
  possible to modify this to make each date a link or checkbox.
  As for DBGrids, I don't know of any packages to generate tables
  automatically. My book goes into some detail on using databases with
  JSPs, some of the information there should (hopefully!) be useful.
  The easiest thing for page developers to use would be a custom tag,
  where you could write something like this to generate a list of tracks
  and times from a CD (this is part of listing 14.14 from the book):
  <TABLE BORDER="1">
  <TR><TH>Name</TH><TH>Length</TH></TR>
  <awl:tracks
  <TR>
  <TD><%= name %></TD>
  <TD><%= length %></YD>
  </TR>
  </awl:tracks>
  </TABLE>
  > What is the best framework for multiuser ability with a database? We are
  > considering and extra field that would increment when a user would open a
  > record for editing. And, then deny updates if the number changes.
  Many databases, such as Oracle, will handle this for you
  automatically. I think Postresql does as well, but you may need to
  explicitly start and end the transaction. However, your proposed
  solution seems to be a good one for databases that don't support
  transactions.
  - Larne
  --
  The fairy told Billy "no." Billy then found that the fairy's head
  was squishy, like a grape.
  from Lenore #3, by Roman Dirge
  Forum Rules
  Development Centers
  -- Android Development Center
  -- Cloud Development Project Center
  -- HTML5 Development Center
  -- Windows Mobile Development Center