DataRow获取数据的相关问题

String trid=request.getSession().getAttribute("trid").toString();
if("".equals(trid)){
response.sendRedirect("login.jsp");
}
int user_trid=Integer.parseInt(trid);
System.out.println(user_trid);
ci.adp.Table table = ci.adp.Table.getInstance("UT_JCW_SERVE");
DataRow row_one=Table.getInstance("ut_jcw_facilitor").queryDataRow("USERID="+user_trid+" AND PUBSTATE='已发布'");
DataRow row_two=table.newDataRow();
row_two.setValue("SSCID", row_one.getValueInt("TRID"));
最后一行row_one.getValueInt("TRID"),总是报空指针错误,不知道什么原因。

因为 你row_one没有setValue

把 row_one 也初始化一下 类似 DataRow row_two=table.newDataRow(); 然后 看看 此时的 row_one 对象里 有没有值