我写了一段Java程序调用 存储过程,用statement.registerOutParameter(5,
java.sql.Types.VARCHAR);方法取得返回值
但是返回值的长度只有50,求高手帮忙。程序如下:
try {
System.out.println("here!");
CallableStatement statement = conn
.prepareCall("{ ? = call clip_get_carton_44 (?, ?,
?, ?) }"); //存储过程名call clip_get_carton_44
statement.registerOutParameter(1, java.sql.Types.INTEGER);
statement.setString(2, p_cartonNo);
statement.setInt(3, p_userid);
statement.registerOutParameter(4, java.sql.Types.INTEGER);
statement.registerOutParameter(5, java.sql.Types.VARCHAR);
//就用这句返回结果
statement.execute();
intRtn = statement.getInt(1);
seqId = statement.getInt(4);
strRtn = statement.getString(5);//结果长度只有50,
存储过程中声明的是char(100)
System.out.println("strRtn
length:"+strRtn.length());//输出50 郁闷
if (intRtn < 0) {
System.out.println("Error/clip_get_data_44: " +
intRtn + " "
+ strRtn);
seqId = -1;
}
} catch (Exception e) {
System.out.println("Error/clip_get_data_44 : " +
e.toString());
throw new Exception("Error/clip_get_data_44 : " +
e.toString());
}