469,612 Members | 1,673 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,612 developers. It's quick & easy.

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.
Expand|Select|Wrap|Line Numbers
  1. import java.sql.*;  
  2. import java.io.*;  
  3. import java.lang.*; 
  4. import java.util.StringTokenizer; 
  5.      public class test {     
  6.        public static void main(String[] args) {     
  7.      try{        
  8.   Class.forName("com.mysql.jdbc.Driver").newInstance();   
  9.        Connection con=DriverManager.getConnection("jdbc:mysql://localhost:3306/test","root","ttt");     
  10.      Statement st=con.createStatement();   
  11.        String sql="select User_Id, Txt_Resume from Resume where User_Id=2";   
  12.        ResultSet rs=st.executeQuery(sql);  
  13.         while(rs.next()) {       
  14.          StringTokenizer str = new StringTokenizer(rs.getString(2)); 
  15.         while (str.hasMoreTokens()) {      
  16.            String data = str.nextToken();        
  17.    System.out.println("Data: "+data);          }          
  18.     }          System.out.println("Data transfer successfully");  
  19.  } catch(Exception e){e.printStackTrace();
  20.   } 
  21.      }      
  22.   }  
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
Jun 24 '08 #1
0 2163

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

2 posts views Thread by =?Utf-8?B?VGVycnk=?= | last post: by
5 posts views Thread by Chris Cowles | last post: by
reply views Thread by Richard Silvers | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.