我想知道以下代码段中的 setNull 和 setInt 方法中的输入参数引用了什么。什么是参数索引。SQL 类型是什么,我如何从数据库列/数据中确定它?
公共无效测试QUERY_UPDATEPORTFOLIO()抛出异常{
UnitTestHelper helper = new UnitTestHelper();
Connection con = helper.getConnection(helper.sourceDBUrl);
Connection conTarget = helper.getConnection(helper.targetDBUrl);
PreparedStatement stmt = con.prepareStatement(TRScheduleStatusCalculator.QUERY_UPDATEPORTFOLIO);
stmt.setNull(1,Types.INTEGER);
stmt.setInt(2,2290);
ResultSet sourceVal = stmt.executeQuery();
stmt = conTarget.prepareStatement(TRScheduleStatusCalculator.QUERY_UPDATEPORTFOLIO);
stmt.setNull(1,Types.INTEGER);
stmt.setInt(2,2290);
ResultSet targetVal = stmt.executeQuery();
assertTrue(helper.resultSetsEqual(sourceVal,targetVal));
}