I was going through some tutuorials in java. I found a mistake in the 'insert image' section.
the following are some lines of that code: pstmt = conn.prepareStatement("insert into image(firstname, lastname, email,image) " + "values(?,?,?,?)"); pstmt.setString(1, fname); pstmt.setString(2, lname); pstmt.setString(4, email); fis=new FileInputStream(image); pstmt.setBinaryStream(3, (InputStream) fis, (int) (image.length()));
here the image is at 4th position but its been set at the 3rd posiiton and email at the 4th position. Kindly have a look. Thank You
Hi Sir,
ReplyDeleteI was going through some tutuorials in java. I found a mistake in the 'insert image' section.
the following are some lines of that code:
pstmt = conn.prepareStatement("insert into image(firstname, lastname, email,image) " + "values(?,?,?,?)");
pstmt.setString(1, fname);
pstmt.setString(2, lname);
pstmt.setString(4, email);
fis=new FileInputStream(image);
pstmt.setBinaryStream(3, (InputStream) fis, (int) (image.length()));
here the image is at 4th position but its been set at the 3rd posiiton and email at the 4th position. Kindly have a look.
Thank You