aspose file tools*
The moose likes JDBC and the fly likes I am getting the following error. Can anyone clear it? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "I am getting the following error. Can anyone clear it?" Watch "I am getting the following error. Can anyone clear it?" New topic
Author

I am getting the following error. Can anyone clear it?

Vin Khan
Greenhorn

Joined: Jun 11, 2013
Posts: 3
[ibm][db2][jcc][10145][10844] Invalid parameter 1: Parameter index is out of range.

These are the codes involved:

qry = new StringBuffer("SELECT a.REQUESTNO, a.UNITCODE, a.DESCRIPTION, LASTMODIFIEDUSER, a.REQUESTEDUSER, a.REQUESTTYPE, a.REQUESTEDDATE, ora.to_char(a.LASTMODIFIEDDATE, 'dd-mm-yyyy') as LASTMODIFIEDDATE1, a.LASTMODIFIEDDATE from CTSBILLUNITREQUEST a LEFT OUTER JOIN CTSBILLUNIT c ON a.UNITCODE = c.UNITCODE");
if(getValueObject().getRequestNo() != null ){qry.append(" WHERE a.REQUESTNO = "+ RequestNo +" ");}
if (tcv.getUnitCode() != null && !"".equals(tcv.getUnitCode()) && !"ALL".equals(tcv.getUnitCode()) ){qry.append(" and a.UNITCODE = c.UNITCODE");}
qry.append(" order by a.UNITCODE");
PreparedStatement ps = getPreparedStatement(qry.toString());
ctr = 1;
if (tcv.getUnitCode() != null && !"".equals(tcv.getUnitCode()) && !"ALL".equals(tcv.getUnitCode()) ){ps.setString(ctr++, tcv.getUnitCode());}
if (tcv.getRequestNo() != null && !"".equals(tcv.getRequestNo()) ){ps.setString(ctr++, tcv.getRequestNo());}
ps.executeQuery();
Vin Khan
Greenhorn

Joined: Jun 11, 2013
Posts: 3
Vin Khan wrote:[ibm][db2][jcc][10145][10844] Invalid parameter 1: Parameter index is out of range.

These are the codes involved:

qry = new StringBuffer("SELECT a.REQUESTNO, a.UNITCODE, a.DESCRIPTION, LASTMODIFIEDUSER, a.REQUESTEDUSER, a.REQUESTTYPE, a.REQUESTEDDATE, ora.to_char(a.LASTMODIFIEDDATE, 'dd-mm-yyyy') as LASTMODIFIEDDATE1, a.LASTMODIFIEDDATE from CTSBILLUNITREQUEST a LEFT OUTER JOIN CTSBILLUNIT c ON a.UNITCODE = c.UNITCODE");
if(getValueObject().getRequestNo() != null ){qry.append(" WHERE a.REQUESTNO = "+ RequestNo +" ");}
if (tcv.getUnitCode() != null && !"".equals(tcv.getUnitCode()) && !"ALL".equals(tcv.getUnitCode()) ){qry.append(" and a.UNITCODE = c.UNITCODE");}
qry.append(" order by a.UNITCODE");
PreparedStatement ps = getPreparedStatement(qry.toString());
ctr = 1;
if (tcv.getUnitCode() != null && !"".equals(tcv.getUnitCode()) && !"ALL".equals(tcv.getUnitCode()) ){ps.setString(ctr++, tcv.getUnitCode());}
if (tcv.getRequestNo() != null && !"".equals(tcv.getRequestNo()) ){ps.setString(ctr++, tcv.getRequestNo());}
ps.executeQuery();
Vin Khan
Greenhorn

Joined: Jun 11, 2013
Posts: 3
Please anyone help me as soon as possible
 
wood burning stoves
 
subject: I am getting the following error. Can anyone clear it?