2010-12-02 52 views
0

java.sql.SQLException:[Microsoft] [適用於JDBC的SQLServer 2000驅動程序] [SQLServer]過程'STP_Insert_tblReceipt'需要未提供參數'@CPVFlag'。JAVA過程錯誤

餘米試圖調用程序時,此時收到錯誤...... 一切都是完美的,,,問號計數類似於參數提供

cs = conn.prepareCall("{call STP_Insert_tblReceipt(?,?,?, ?,?,?, ?,?,?, ?,?,?, ?,?,?, ?,?,?, ?,?,?, ?,?,?, ?,?,?)}"); 
// cs = conn.prepareCall("{call STP_Receipt_Form_Insertion_Trial(?,?,?, ?,?,?, ?,?,?, ?,?,?, ?)}"); 
cs.setLong(1, Long.parseLong(txtMobileNo.getText())); 
cs.setString(2, String.valueOf(cboDistributor.getSelectedItem())); 
cs.setLong(3, Long.parseLong(txtBoxNo.getText())); 
cs.setInt(4, Integer.parseInt(txtFileNo.getText())); 
cs.setString(5, pickUp_date); 
cs.setString(6, rec_date); 
cs.setString(7, String.valueOf(cmbCtrlNo.getSelectedItem())); 
cs.setString(8, UserName); 
cs.setString(9, rec_date); 
cs.setString(10, RegionLocation); 
cs.setString(11, txtRemark.getText().trim()); 
cs.setString(12, txtSimNo.getText().trim()); 
cs.setInt(13, 2); 
cs.setString(14, String.valueOf(cmbAryanRegion.getSelectedItem())); 
cs.setString(15, String.valueOf(cboPickUpType.getSelectedItem())); 
cs.setString(16, String.valueOf(txtCafNo.getText())); 
cs.setString(17, distributorId); 
//cs.setString(18, circleName); 
cs.setString(18, cboCircle.getSelectedItem().toString()); 
cs.registerOutParameter(19, java.sql.Types.INTEGER); 
cs.setString(20, auditorName); 
cs.setString(21, retailerName); 
cs.setString(22, retailerCode); 
cs.setInt(23, mappedFlag); 
//cs.setString(24, distCode); 
cs.setString(24, cboDistCode.getSelectedItem().toString()); 
//cs.setString(25, zoneName); 
cs.setString(25, cboZone.getSelectedItem().toString()); 
cs.setString(26, comment); 
**cs.setInt(27, 1);** **this is for CPV Flag** 

這cs.execute後() ;

+1

您收到的錯誤是什麼? – 2010-12-02 04:57:05

回答

0

請用SQL參數列表添加proc的定義。 檢查PROC,最有可能的錯誤是:

cs.registerOutParameter(19, java.sql.Types.INTEGER); 

變量可能是IN-OUT參數。