Problem with Stored Procedure and inout parameter

Hi.

This is the code of my stored procedure:

procedure sample_inout(i1 in varchar2, io1 in out varchar2, ritorno out varchar2) as

begin

io1 := i1 || io1;

ritorno := 'PEPPINIELLO VOGATORE';

end;

and this is the code of my program:

Class.forName ("sun.jdbc.odbc.JdbcOdbcDriver");

Connection Cn=DriverManager.getConnection("jdbc:odbc:europadb",userID,passwd);

CallableStatement cstmt = Cn.prepareCall (sql);

cstmt.setString (1,"paipo"); //parameter 1

cstmt.setString (2,"plauto"); //parameter 2

cstmt.registerOutParameter(2 , Types.VARCHAR);

cstmt.registerOutParameter (3 , Types.VARCHAR);

cstmt.execute();

System.out.println (cstmt.getString (2));

System.out.println (cstmt.getString (3));

i should receive:

paipoplauto and PEPPINIELLO VOGATORE

but i receive only paipopl and PEPPINIELLO VOGATORE

anyone can tell why?

thanks

Daniele.

[988 byte] By [rossifumi80] at [2007-9-26 6:41:32]
# 1
Have you tried registering out parameters BEFORE setting in ones? I'm not sure, but I think it should be donde this way.And are you using the right methods to retrieve values?Hope this helps.
nadala at 2007-7-1 16:00:33 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 2
seems like your 2nd Parameter is cut... could you try with other values and tell me what the result is then?
rennie1 at 2007-7-1 16:00:33 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...