|
-
August 17th, 2011, 04:43 AM
#1
problem while image insertion
File file = new File("C:\\Users\\admin\\Desktop\\server\\flower1.jpg");
FileInputStream fs = new FileInputStream(file);
PreparedStatement ps = conn.prepareStatement("insert into picprop(picname,picsize,pictype,image) values(?,?,?,?)");
ps.setString(1,"yellow");
ps.setInt(2,89);
ps.setString(3,"jpeg");
ps.setBinaryStream(4,(InputStream)fs,(int)(file.length()));
int i=ps.executeUpdate();;
pw.println("value of i is:"+i);
The statement[ps.setBinaryStream(4,(InputStream)fs,(int)(file.length()));] is not getting executed. what night be the reason?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|