Let's create a website using the framework of the subject Breakdown of all 4 times
--Eclipse installed --DB2 installed (required for 4th time)
Create classes (Beans) under src
Fill in your favorite class name / package name. (Goods or anything ok. Search symmetric)
Product.java
package practice;
public class Products {
//Keep member variables private
private int price;
private int weight;
private String name;
private String material1;
private String category;
public void setAll(){
//Now write SQL. This time I will write the value directly.
this.price=1404;
this.weight=300;
this.name=""My disappearance" Fuminori Nakamura";
this.material1="paper";
this.category="book";
}
public int getPrice() {
return price;
}
public int getWeight() {
return weight;
}
public String getName() {
return name;
}
public String getMaterial1() {
return material1;
}
public String getCategory() {
return category;
}
}
4.Model is now complete. Was it too light? Lol Please be prepared for Controller as the difficulty level goes up at once.
Understanding the MVC framework with server-side Java 3/4 Controller http://qiita.com/kyogom/items/6604e59c20f0c45af983
Recommended Posts