このメソッドを完了するためには、何を渡す必要がありますか?エラー:完了するためにメソッドに渡す必要があるもの
DBConnection型のfireSelect(String、String []、String [])メソッドは引数(String)には適用されません。
これはメソッドです。)
public static ResultSet fireSelect(String query, String[] types,
String[] values) {
try {
PreparedStatement ps = getInstance().prepareStatement(query);
if (types != null) {
for (int i = 0; i < types.length; i++) {
if (types[i].equals("int"))
ps.setInt((i + 1), Integer.parseInt(values[i]));
else if (types[i].equals("string"))
ps.setString((i + 1), values[i]);
else if (types[i].equals("double"))
ps.setDouble((i + 1), Double.parseDouble(values[i]));
}
}
return ps.executeQuery();
} catch (Exception e) {
try {
connection = null;
if (cnt < 2) {
connection = getInstance();
cnt++;
fireSelect(query, types, values);
} else {
cnt = 0;
}
} catch (Exception ee) {
System.out.println("Exception :" + ee);
}
}
return null;
}
、これは私はあなたが機能fireSelect(にすべての3 argumensを渡す必要がありCALの間に渡すために使用し、この方法
ResultSet rs = DBConnection.fireSelect(
"select dealer_id,car_servicing,car_servicing,cost,features "
+ " from dealer_car,carservicing where "
+ "dealer_car.car_servicing=carservicing.car_servicing and dealer_id="
+ dealerId);
エラーを読んだ場合、1つのStringを渡していますが、それに続く2つのString配列も 'fireSelect'に期待しています。 Javaでは、パラメータは必須ですが、他の言語のようなデフォルト値はありません – AxelH