store doc file in database.
import java.io.*;
import java.sql.*;
public class StoreFile {
public static void main(String[] args)
{
try
{
Class.forName("oracle.jdbc.driver.OracleDriver");
Connection con=DriverManager.getConnection(
"jdbc:oracle:thin:@localhost:1521:xe","navjyoti","navjyoti");
PreparedStatement ps=con.prepareStatement("insert into vitae values(?,?)");
File f=new File("e:\\Naveencv.doc");
FileReader fr=new FileReader(f);
ps.setString(1,"navee");
ps.setCharacterStream(2,fr,(int)f.length());
int i=ps.executeUpdate();
System.out.println(i+" records affected");
con.close();
}
catch (Exception e)
{e.printStackTrace();}
}
}