Results 1 to 1 of 1
- 09-30-2010, 08:16 PM #1
Senior Member
- Join Date
- May 2010
- Posts
- 113
- Rep Power
- 0
how to get the resultset output into an output file
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()); }
Similar Threads
-
how to change the layout of an input file and write to an output file
By renu in forum New To JavaReplies: 8Last Post: 05-12-2010, 07:19 PM -
No output to file
By shiva in forum Java ServletReplies: 0Last Post: 04-24-2009, 02:06 PM -
Java, output string, getting correct output? HELP!
By computerboyo in forum New To JavaReplies: 2Last Post: 02-25-2009, 11:44 PM -
Search a word(taken from one file) in another file and give the line as the output
By SwapnaNaidu in forum New To JavaReplies: 7Last Post: 11-19-2008, 02:09 PM -
Callling stored procedures with input/output parameters and ResultSet
By Java Tip in forum Java TipReplies: 0Last Post: 02-11-2008, 08:47 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks