The third assignment--pair programming

Source: Internet
Author: User
Tags import database

Remark: Cai _031302601, Yezhiyu _031302628

Functional Analysis:

The first requirement of this job is to be able to import the contents of the Excel file into the database, because the last semester to use the database practice is the Java language, and this job and the database is also related, so we want to implement this function through Java. In the process of learning how to import Excel files into a database we found Jexcel this API, which makes our Java programming easier, compared with other languages.

The second requirement is to implement the data in the display database, the project of our group is web-side, we think, since the first requirement has been implemented in Java, the second requirement also use Java implementation will be more convenient? Sure enough, in search of how to write Web pages in Java, found the Javaweb, through the MU-net video learning, we also mastered how to display the database data on the Web page.

Implementation ideas:

First, our group through Java to implement the contents of the Excel file into the database, and display the contents of the database we are using Javaweb display on the page.

When we import the contents of the Excel file into the database, we use the Jexcel API, which makes the code easier and easier to program, and of course, if you want to use Jexcel, you have to download it first. and add Jxl.jar to your project LIB, otherwise you won't be able to import the required package. Download URL: http://jexcel.en.softonic.com/(if the URL is not available, you can Baidu.) )

The next step is to import the files needed to connect to the database "Sqljdbc4.jar" (The database management software I use is SQL Server 2008), and if you are MySQL then the method is different and you have to learn it by yourself.

Now that we have all the files we need, we're ready to start writing code! ~

The important thing to note in the code is that the Excel import database is imported in one line and implemented with a two-layer for loop. The outside for is the row, the inside is the column. The code that connects the database is similar.

Second, the content of the display database on the page is implemented by JSP, our group first wrote three classes, the first is the entity major, used to save the contents of the database table and displayed on the page, and one is dbconnect used to connect the database, Finally, Dboperate is used to assign the values in the database to major. Finally, import them in index and then display the contents of the entity major on the page.

Design of the database:

At first we set the properties of the database columns according to the real properties of each column in the table, but in my design I found that everything I got from the Excel table was a string type, and then I could only change the properties of each column in the database to the varchar type, and changed a lot of places ....

For some properties in the database we set it to be empty, such as the computer hours (some classes do not have the machine part), notes and so on. For the primary key setting, we added a separate column number num.

Githubl Links: https://github.com/SandStorm2015/CourseManagement

Log:

Two Knot pairs Summary:

Through these two experiences, I found it interesting to have a team knocking code to write a document, and in the process of pairing, I found that to accomplish a work, two must work together to have a common goal, to adopt a unified tool, especially in the context of a unified tool, or how to accomplish a project together, In addition, the communication between two people is more important, only through continuous communication, to understand each other's ideas and difficulties, understand the other side of the idea, two people will modify their original idea to combine the idea of the other side to achieve the best results, and understand each other's confusion can use two efforts to solve a person's problem , which makes it faster to solve problems. At the same time in the communication we can find two people for the project needs of the understanding of how, I have deep experience, in my second pairing process of our two people understanding of the needs of the different, after a heated debate, we asked our | Customers "to understand exactly how the requirements are, and finally adopt the most close to the needs of the solution. So it is very important to communicate and unify in team work.

The third assignment--pair programming

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.