|
|
|
JAVA, JSP ถ้าจะแสดงข้อความว่าบันทึกข้อมูลได้ทำไงครับ ช่วยดันด้วยครับ |
|
|
|
|
|
|
|
Code (Java)
public void save() {
String sql = ("insert into Member(name,suname,username,password,email,sex,address,privince,zipcode,tol,grop_user) values( '"
+ this.getName()
+ "','"
+ this.getSuname()
+ "','"
+ this.getUsername()
+ "','"
+ this.getPassword()
+ "','"
+ this.getEmail()
+ "','"
+ this.getSex()
+ "','"
+ this.getAddress()
+ "','"
+ this.getPrivince()
+ "','"
+ this.getZipcode()
+ "','"
+ this.getTol()
+ "','"
+ this.getGrop_user() + "')");
System.out.println(sql);
try {
Statement stmt = this.getConnecttion().createStatement();
int stat = stmt.executeUpdate(sql);
System.out.println("insert Complete .." + stat);
stmt.close();
} catch (SQLException e) {
System.out.println("Not insert Complete ..");
e.printStackTrace();
} finally {
if (connection != null) {
try {
connection.close();
} catch (SQLException e) {
e.printStackTrace();
}
}
}
}
ถ้าจะแสดงข้อความว่าบันทึกข้อมูลได้ทำไงครับ
Tag : JAVA, JSP
|
|
|
|
|
|
Date :
2013-04-29 15:35:50 |
By :
hitachi |
View :
1430 |
Reply :
1 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 02
|