select file using Stored Procedure

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Geethu03
    New Member
    • Dec 2006
    • 45

    select file using Stored Procedure

    Hi
    I had a doubt in Mysql Stored procedure. i need to read a text file (that is stored in mysql database) using the Stored procedure. i know little bit about the Stored procedure but i am not able to read a file.
    Code:
    import java.sql.*;  
    import java.io.*;  
    import java.lang.*; 
    import java.util.StringTokenizer; 
         public class test {     
           public static void main(String[] args) {     
         try{        
      Class.forName("com.mysql.jdbc.Driver").newInstance();   
           Connection con=DriverManager.getConnection("jdbc:mysql://localhost:3306/test","root","ttt");     
         Statement st=con.createStatement();   
           String sql="select User_Id, Txt_Resume from Resume where User_Id=2";   
           ResultSet rs=st.executeQuery(sql);  
            while(rs.next()) {       
             StringTokenizer str = new StringTokenizer(rs.getString(2)); 
            while (str.hasMoreTokens()) {      
               String data = str.nextToken();        
       System.out.println("Data: "+data);          }          
        }          System.out.println("Data transfer successfully");  
     } catch(Exception e){e.printStackTrace();
      } 
         }      
      }
    the above java code read the text file and print the word. the same thing i want to do using the mysql StoredProcedure .

    give the idea to do my task.

    Thank you
    Geethu
Working...