public void setString(int parameterIndex, String x) throws  SQLException { XSQLVAR sqlvar = fixedStmt.getInSqlda().sqlvar[parameterIndex - 1]; if ((sqlvar.sqltype & ~1) == GDS.SQL_TEXT) { byte[] supplied = x.getBytes(); if (supplied.length > sqlvar.sqllen) { throw new DataTruncation(parameterIndex, true, false, supplied.length, sqlvar.sqllen); } if (supplied.length == sqlvar.sqllen) { sqlvar.sqlind = 0; sqlvar.sqldata = supplied; return; }  StringBuffer padded = new StringBuffer(sqlvar.sqllen); padded.append(x); for (int i = 0; i < sqlvar.sqllen - supplied.length; i++) { padded.append(' '); } sqlvar.sqlind = 0; sqlvar.sqldata = padded.toString().getBytes();  return; }   if ((sqlvar.sqltype & ~1) == GDS.SQL_VARYING){ sqlvar.sqlind = 0; sqlvar.sqldata = x.getBytes(); return; } throw new SQLException("Not a String, type: " + sqlvar.sqltype);
public void setString(int parameterIndex, String x) throws SQLException { getField(parameterIndex).setString(x);
    public void setString(int parameterIndex, String x) throws  SQLException {        XSQLVAR sqlvar = fixedStmt.getInSqlda().sqlvar[parameterIndex - 1];        if ((sqlvar.sqltype & ~1) == GDS.SQL_TEXT) {            byte[] supplied = x.getBytes();//Should be using encoding??            if (supplied.length > sqlvar.sqllen) {                throw new DataTruncation(parameterIndex, true, false, supplied.length, sqlvar.sqllen);            }            if (supplied.length == sqlvar.sqllen) {                sqlvar.sqlind = 0;                sqlvar.sqldata = supplied;                return;            }            //else pad with spaces            StringBuffer padded = new StringBuffer(sqlvar.sqllen);            padded.append(x);            for (int i = 0; i < sqlvar.sqllen - supplied.length; i++) {                padded.append(' ');            }            sqlvar.sqlind = 0;            sqlvar.sqldata = padded.toString().getBytes();            //log.debug("padded: /" + x + "/ to /" + padded + "/ length: " + ((byte[])sqlvar.sqldata).length);            return;        }        if ((sqlvar.sqltype & ~1) == GDS.SQL_VARYING){            sqlvar.sqlind = 0;            sqlvar.sqldata = x.getBytes();//Should be using encoding??            return;        }        throw new SQLException("Not a String, type: " + sqlvar.sqltype);    }