我在这里有准备好的工作声明:
public boolean requestBuy(int user_id, String broker_name, String company_name, int shares, String comments)
{
....
....
pstmnt = conn.prepareStatement("INSERT INTO broker_requests VALUES" +
"(br_request_id_increment.nextval,?,?,?,?,?,?)");
pstmnt.setInt(1, user_id);
pstmnt.setString(2, broker_name);
pstmnt.setString(3, "Buy");
pstmnt.setInt(4, shares);
pstmnt.setString(5, company_name);
pstmnt.setString(6, comments);
pstmnt.executeQuery();
logger.info("Request Share Purchase: " + company_name + " has requested to purchase " + shares + " from" + company_name);
return true;
}
}
我想要做的是将结果集存储到不同的变量(或者可能是 arrayList?)中,以便在不同的类中使用这些值。有任何想法吗?