I tired the following steps :
1. create a File object
2. create a FileInputStream
3. use a PreparedStatement and the setBinaryStream method
i used the code:
File f=new File("d:/a.txt");
long len=f.length();
byte[] fil=new byte[(int)len];
FileInputStream fin=new FileInputStream(f);
int a=0;
a=fin.read(fil);

Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
conn1=DriverManager.getConnection(url,"","");
PreparedStatement p=conn1.prepareStatement("Update sad set kee=?");
p.setBinaryStream(1,fin,100);
p.executeUpdate();

but i get the following exception:
java.sql.SQLException: End of InputStream reached before satisfying length specified when InputStream was set
kindly if you could help.