Olá a todos,
Sou novo neste Forum e também sou novo no Java.
Estou com dificuldades com um software que estou tentando fazer.
Bom é o seguinte tenho uma Classe a seguinte classe:
public double getP(String symbol) {
if (con != null) {
try {
Statement stmt = con.createStatement();
String sql = "SELECT * FROM stocks WHERE NAME='
+ symbol + "'";
ResultSet rs = stmt.executeQuery(sql);
if (rs.next()) {
return rs.getDouble("VALUE");
}
return -1;
} catch (Exception e) {
}
}
return -2;
}
Em outra classe estou tentando chamar a getP e passando os paramentros para realizar a consulta,
Mas está dando um erro.
Olha só como estou fazendo:
import jv.pj.StockServiceStub.GetPriceResponse;
public static void main(String[] args) throws RemoteException {
StockServiceStub stub = new StockServiceStub();
String nome = new string();
GetPriceResponse resp = stub.GetP(nome);
System.out.println("Nome = " + resp.get_return());
}
O erro que aparece é o seguinte:
[color=red]the method GetP in the type stockservicestub is not applicable for the arguments (string)[/color]
na linha que tem o codigo GetPriceResponse resp = stub.GetP(nome);
O que estou fazendo de errado?
Obrigado.