Use Java to implement "simple dry special" -2 on the Web
3.2, premise
The system requires the database support, you can choose any database system, such as DB2 or Oracle, or the simplest Access, no special requirements, we just want to build several tables in the database, used to store algorithms The result is calculated and supplied to the display page. I use Oracle, so the following SQL will be an example of oracle, you can modify SQL taught in other databases supported.
As for how to choose development tools, there is no special requirement, I use IBM WSAD (IBM WebSphere Studio Application DEVEPLOPER V5), you can use JBuilder or Eclipse Dreamware or IBM's Homgpage Builder or other other development tools .
3.3, implement step 1 - Create a database table
Create a corresponding table "Plansc" that is used to store data of "planning construction progress", which is data in the red line in the figure.
CREATE TABLE PLANSC
(
ID Number NOT NULL,
Proname varchar2 (300) Not null,
Stallm Number NOT NULL,
Endallm Number NOT NULL,
Iall Number NOT NULL,
Startdate varchar2 (50) Not null,
Enddate varchar2 (50) Not null
)
Create a corresponding table "PlansC2", which is used to store the "adjustment schedule" data, which is the data of the green line in the figure.
Create Table Plansc2
(
ID Number NOT NULL,
Proname varchar2 (300) Not null,
Stallm Number NOT NULL,
Endallm Number NOT NULL,
Iall Number NOT NULL,
Startdate varchar2 (50) Not null,
Enddate varchar2 (50) Not null
)
The two table structures are the same, and we explain the structure of the table to facilitate the reader's better understanding of the meaning of each field of the table.
We use a period of time such as a whole from 2003 to 2010 (you can change according to your needs),
Then, this time period is divided, and the first section is 2003-selected start time; the second section is the beginning time of the selected start time - the end time selected; the third section is the end time of the selected end -2010; The scale is in the month, (here is involved in accuracy issues, you can increase the requirements according to your requirements, such as the sky, the accuracy has increased much, but the progress improvement will improve the difficulty and back graphic display of the programming Difficulty). Then you can break down to 3 variables. Please see (refer to Figure 3).
(Refer to Figure 3)
Tip: The time value of the database table you see here is calculated, you can create each entry (where you can design it you can design it yourself), you can first give any value as an initial value, such as 0 . After you have changed the time period, our programs can then update these values.
3.4, implement step 2 - Create a page
You can create your page using Dreamware or other pages (specific production is not available, please make it self-made), the effect after the page production is as follows (refer to Figure 4), in fact, this form can be fully constructed , That is, your entry is dynamic, then the form of the page is dynamic, this is a JSP programmer is a gentle thing, our performance static form, in the column of the table, embedding <% %> JSP code, those code is used to display. Modify the page, please (see Figure 5). The JSP code that is also embedded in the form is used to display the data, as for these code how to display, we will introduce. There are some points here: indicating that the width of the table column of time (year) is designed to be consistent, such as 8%.
(Refer to Figure 4)
(Refer to Figure 5)
3.5, implement step 3-analysis code
When the user enters the first page, click the Edit button, enter the second page, then select the time period and select the adjustment object (refer to Figure 6), finally click OK, the system can calculate and save our choice and display out result. We design a SaveChangePlan.jsp's JSP file to perform job data and computing data, and transfer to different pages based on saving results. Let's first analyze the code of SaveChangeplan.jsp. Please refer to (Table 1).
(Refer to Figure 6)