ArrayIndexOutOfBoundsException at CallableStatement.getClob()
I'm using hsqldb 2.0-GA, both at the server and the client. I've defined the following procedure at the database: 

    

    create procedure BR1.PROC_A(out p1 clob, out p2 int) 
    READS SQL DATA BEGIN ATOMIC 
    SET p1 = 'dafsdfasdfaefafeajfiwejifpjajsidojfakmvkamsdjfadpsjfoajsdifjaos'; 
    SET p2 = 0; 
    end 



Then, I've tried to do the following inside a Java method: 

    CallableStatement stmt = factory.getCallableStatement("{call BR1.PROC_A(?, ?)}"); 
    try { 
    	stmt.registerOutParameter(1, Types.CLOB); 
    	stmt.registerOutParameter(2, Types.INTEGER); 
    	stmt.execute(); 
    
    	if (stmt.getInt(2) == ERROR) 
    		throw new IllegalStateException("Error with routine!"); 
    
    	String res = convertToString(stmt.getClob(1).getCharacterStream()); 
    	return parser.parseAgregacoes(res); 
    } 
    finally { 
    	stmt.close(); 
    } 

The following exception is thrown: 

    Caused by: java.lang.ArrayIndexOutOfBoundsException: 0 
    	at org.hsqldb.jdbc.JDBCCallableStatement.getClob(Unknown Source) 

Can somebody help me? Thanks! 
ArrayIndexOutOfBoundsException at CallableStatement.getClob()
===

I'm using hsqldb 2.0-GA, both at the server and the client. I've defined the following procedure at the database: 

    

    create procedure BR1.PROC_A(out p1 clob, out p2 int) 
    READS SQL DATA BEGIN ATOMIC 
    SET p1 = 'dafsdfasdfaefafeajfiwejifpjajsidojfakmvkamsdjfadpsjfoajsdifjaos'; 
    SET p2 = 0; 
    end 



Then, I've tried to do the following inside a Java method: 

    CallableStatement stmt = factory.getCallableStatement("{call BR1.PROC_A(?, ?)}"); 
    try { 
    	stmt.registerOutParameter(1, Types.CLOB); 
    	stmt.registerOutParameter(2, Types.INTEGER); 
    	stmt.execute(); 
    
    	if (stmt.getInt(2) == ERROR) 
    		throw new IllegalStateException("Error with routine!"); 
    
    	String res = convertToString(stmt.getClob(1).getCharacterStream()); 
    	return parser.parseAgregacoes(res); 
    } 
    finally { 
    	stmt.close(); 
    } 

The following exception is thrown: 

    Caused by: java.lang.ArrayIndexOutOfBoundsException: 0 
    	at org.hsqldb.jdbc.JDBCCallableStatement.getClob(Unknown Source) 

Can somebody help me? Thanks! 