db server is ms sqlserver.

the following is my procedure code:

CREATE PROCEDURE [test_cc]
@ww char(20) output
AS
begin
select @ww='666666666'
select col_name from table_name
end
GO

then,following is some of my jdbc invoking procedure code:

try {
Connection conn = DBC.getConnection();
if (conn == null) {
System.out.println("Failed");
}
else {
conn.setAutoCommit(false);

CallableStatement proc = conn.prepareCall("{call test_cc (?)}");
proc.registerOutParameter(1,Types.VARCHAR);
proc.execute();

ResultSet rs = proc.getResultSet();
String aa = proc.getString(2);
if (rs == null) {
System.out.println(" RS is null"); #-----1
}
else {
ResultSetMetaData metadata = rs.getMetaData();#---2
while (rs.next()) {
..............
}
}
}
catch (Exception e) {
}

but the result that run is :i can get the variable aa value,it is '666666666',but the performing can`t get into #1 point,at #2 point,it throw the exception bject has bean closed.

please tell me ,how to get the variable aa value,and get resultset