我想知道什麼輸入參數引用setNull和setInt方法在下面的代碼片段。什麼是參數索引。什麼是SQL類型,以及如何從數據庫列/數據中確定?有人可以告訴我什麼是setNull和setInt在這個聲明
公共無效testQUERY_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));
}
因此,QUERY WAS – Croeber
從tr_request中選擇requestid,methodid,workplanid,requiredstart,requiredend其中fundingportfolioid =?「+」和requestid <>? _______________________________________________________________________因此,第一個參數1(1,Types.INTEGER)用於portfolioid。第二個參數2(2,290)用於requestid。那是對的嗎。無論哪裏?標記是? – Croeber
是的,從你上面的查詢多數民衆贊成正確:) – PermGenError