|
@@ -37,10 +37,10 @@ public class MariaDBSelect {
|
37
|
37
|
|
38
|
38
|
|
39
|
39
|
// insert
|
40
|
|
- boolean result = statement.execute("insert into a(c1,c2) values(v1, v2);");
|
|
40
|
+ boolean result = statement.execute("insert into employees(name,c2) values('가준', v2);");
|
41
|
41
|
// boolean result = statement.execute(String.format("insert into a(c1,c2) values(%d, %s);", v1, v2));
|
42
|
|
- if(result) System.out.println("정상처리");
|
43
|
|
- else System.out.println("비정상처리");
|
|
42
|
+ if(result) System.out.println("ResultSet 값 있다.");
|
|
43
|
+ else System.out.println("업데이트 된 행이 있거나 리턴되는 값이 없는 경우");
|
44
|
44
|
|
45
|
45
|
// update
|
46
|
46
|
// int result = statement.executeUpdate("update a set c1 = v1;"); // result = 업데이터된 행의 숫자
|