結果セットに結果を追加し、テーブルを使用して結果を表示したいのは私のJavaコードです
while (resultSet.next()) {
Object[] objects = {
resultSet.getDouble("January"),
resultSet.getDouble("February"),
resultSet.getDouble("March"),
resultSet.getDouble("April"),
resultSet.getDouble("May"),
resultSet.getDouble("June"),
resultSet.getDouble("July"),
resultSet.getDouble("August"),
resultSet.getDouble("September"),
resultSet.getDouble("October"),
resultSet.getDouble("November"),
resultSet.getDouble("December"),
};
model.addRow(objects);
}
エラーには、「列 '1 月' が見つかりません」と表示されます。
評判が悪くて申し訳ないので、ストアドプロシージャの結果を以下に書きます。
categoryid January February....
1 3000 5000 (double)....
クエリコード:
CallableStatement callableStatement = connection.prepareCall(sql);
if (cobAccount.getSelectedIndex() != 0) {
String accountid = cobAccount.getSelectedItem().toString()
.substring(0, 1);
callableStatement.setString(1, accountid);
} else {
callableStatement.setString(1, "0");
}
if (cobYear.getSelectedIndex() != 0) {
String year = cobYear.getSelectedItem().toString();
callableStatement.setString(2, year);
} else {
callableStatement.setString(2, "0");
}
if (cobMember.getSelectedIndex() != 0) {
String memberid = cobMember.getSelectedItem().toString()
.substring(0, 1);
callableStatement.setString(3, memberid);
} else {
callableStatement.setString(3, "0");
}
if (!"".equals(txtMinmoney.getText())) {
double minMoney = Double.valueOf(txtMaxmoney.getText());
callableStatement.setDouble(4, minMoney);
} else {
callableStatement.setDouble(4, '0');
}
if (!"".equals(txtMaxmoney.getText())) {
double maxMoney = Double.valueOf(txtMaxmoney.getText());
callableStatement.setDouble(5, maxMoney);
} else {
callableStatement.setDouble(5, '0');
}