Hi All,
I am placing the code here :
UnitForm uni - javabean
InputStream fstream=null;
fstream=uni.getIstream();
int c=fstream.available();
String query = "INSERT INTO elunit (unitid, domainid, unitname, unittype, "+
"description, content_type, filename, content) "+
"VALUES (nextval('elms_seq_unit'),?,?,?,?,?,?,?) ";
ps = con.prepareStatement(query);
ps.setInt(1,Integer.parseInt(uni.getDomainid()));
ps.setString(2,uni.getUnitname());
ps.setString(3,uni.getUnittype());
ps.setString(4,uni.getDescription());
ps.setString(5,uni.getContenttype());
ps.setString(6,uni.getFilename());
ps.setBinaryStream(7, fstream, c);
ps.executeUpdate();
ps.close();
Pleaze help,
Sankar