Hi

Anyone pls tell me , how to get the results of the function into an output file .

Java Code:
try {
// Call a function with 2 IN parameter; the function returns a cursor
//		BufferedWriter writeOutputFile = new BufferedWriter(new FileWriter(OutputFile, false));
		proc_stmt = connection.prepareCall("{? = call RATES.PKG_GET_DATA.F_MAIN_EXTRACT(?,?)}");

// Register the type of the return value
		proc_stmt.registerOutParameter(1,OracleTypes.CURSOR);		   
		proc_stmt.setString(2,user_id);
		proc_stmt.setInt(3,Name);
// Execute and retrieve the returned value
		proc_stmt.execute();
		ResultSet rs = (ResultSet) proc_stmt.getObject(1); // So, here it works.
//		System.out.println("The output of the function is :"+rs);  
		//print the results
		int count = 0;
		while (rs.next()) {
			count++;
//			???????(what code should be here to dump the output from function into an output file?????
//			writeOutputFile.write(mainStr);
//			writeOutputFile.newLine();
			System.out.println("rs count was: " + count);
			System.out.println("here i am inside the while loop");
		}
		proc_stmt.close();	
	}catch (SQLException e) {
		System.out.println("Exception occurred: " + e.getMessage());
	}