質問編集履歴

1

誤字

2018/04/14 18:08

投稿

kei-chan
kei-chan

スコア14

test CHANGED
File without changes
test CHANGED
@@ -14,6 +14,20 @@
14
14
 
15
15
  executeQuery()が実行できないようです。
16
16
 
17
+
18
+
19
+
20
+
21
+ SQL文はMysqlで試したところ実行できていました。
22
+
23
+
24
+
25
+
26
+
27
+
28
+
29
+
30
+
17
31
  ### 発生している問題・エラーメッセージ
18
32
 
19
33
 
@@ -38,9 +52,11 @@
38
52
 
39
53
 
40
54
 
55
+ ResultSet rs = null;
56
+
41
- ResultSet rs = null; PreparedStatement ps = null; OrdersBean
57
+ PreparedStatement ps = null;
42
-
43
- ordersBean = new OrdersBean();
58
+
59
+
44
60
 
45
61
  DBConnecter conn = new DBConnecter();
46
62
 
@@ -48,11 +64,13 @@
48
64
 
49
65
 
50
66
 
51
- String id=form.getProjectCode();
52
-
53
-
54
-
55
- String orders= "UPDATE orders SET company_id=?, work_period_from=?, work_period_to=?, standard_unit_price=? WHERE project_code=?";
67
+
68
+
69
+
70
+
71
+
72
+
73
+ String orders="update orders o inner join companies r on o.company_id = r.company_id set r.company_name=?, o.company_id=?, work_period_from=?, work_period_to=?,standard_unit_price=? where project_code=?";
56
74
 
57
75
  String projects="UPDATE projects SET project_name=?, work_location=?, "
58
76
 
@@ -60,9 +78,9 @@
60
78
 
61
79
  + "engineer_family_name_kana=?, engineer_first_name_kana=?, engineer_age=?, engineer_tel=? WHERE project_code=?";
62
80
 
63
- String received_orders="UPDATE received_orders SET company_id=?, work_period_to=?, work_period_from=?, standard_unit_price=? WHERE project_code=?" ;
64
-
65
- String company="UPDATE companies company_name=? WHERE company_id=?";
81
+ String received_orders="update received_orders re inner join companies rr on re.company_id = rr.company_id set rr.company_name=?, re.company_id=?, work_period_from=?, work_period_to=?,standard_unit_price=? where project_code=?";
82
+
83
+
66
84
 
67
85
 
68
86
 
@@ -80,19 +98,23 @@
80
98
 
81
99
 
82
100
 
101
+ ps.setString(1, update.getCompanyName1());
102
+
83
- ps.setString(1, update.getCompanyId());
103
+ ps.setString(2, update.getCompanyId());
84
-
104
+
85
- ps.setString(2,update.getOcWorkPeriodFrom());
105
+ ps.setString(3,update.getOcWorkPeriodFrom());
86
-
106
+
87
- ps.setString(3, update.getOcWorkPeriodTo());
107
+ ps.setString(4, update.getOcWorkPeriodTo());
88
-
108
+
89
- ps.setString(4, update.getoStandardUnitPrice());
109
+ ps.setString(5, update.getoStandardUnitPrice());
90
-
110
+
91
- ps.setString(5, update.getProjectCode());
111
+ ps.setString(6, update.getProjectCode());
112
+
113
+
114
+
115
+
116
+
92
-
117
+ //ps.executeQuery();
93
-
94
-
95
-
96
118
 
97
119
 
98
120
 
@@ -124,29 +146,31 @@
124
146
 
125
147
  ps.setString(11, update.getProjectCode());
126
148
 
149
+
150
+
151
+
152
+
127
- ps.setString(12, update.getProjectCode());
153
+ //ps.executeQuery();
128
-
129
-
130
-
131
-
132
-
133
-
134
-
154
+
155
+
156
+
157
+
158
+
135
- ps=conn.connect().prepareStatement(received_orders);
159
+ ps=conn.connect().prepareStatement(received_orders);
160
+
161
+
162
+
136
-
163
+ ps.setString(1, update.getCompanyName2());
137
-
138
-
139
-
140
-
164
+
141
- ps.setString(1, update.getrCompanyId());
165
+ ps.setString(2, update.getrCompanyId());
142
-
166
+
143
- ps.setString(2,update.getrWorkPeriodFrom());
167
+ ps.setString(3,update.getrWorkPeriodFrom());
144
-
168
+
145
- ps.setString(3, update.getrWorkPeriodTo());
169
+ ps.setString(4, update.getrWorkPeriodTo());
146
-
170
+
147
- ps.setString(4, update.getrStandardUnitPrice());
171
+ ps.setString(5, update.getrStandardUnitPrice());
148
-
172
+
149
- ps.setString(5, update.getProjectCode());
173
+ ps.setString(6, update.getProjectCode());
150
174
 
151
175
 
152
176