getting ORA-00913: too many values. don't know how to resolve this issue please anyone could help me?
con2 = DriverManager.getConnection("Jdbc:Oracle:thin:@localhost:1521:XE", "system",
"oracle123");
File image=new File("E:/Users/ganesh/Desktop/line.jpg");
String sql="insert into blobtab values(?,?)";
pstmt=con2.prepareStatement(sql);
pstmt.setString(1,"akshita");
fis=new FileInputStream(image);
pstmt.setBinaryStream(2,(InputStream)fis,(int)(image.length()));
int s = pstmt.executeUpdate();
if (s > 0) {
System.out.println("Image Uploaded successfully !");
} else {
System.out.println("unsucessfull to upload image.");
}
con2.close();
pstmt.close();
This would suggest that your blobtab table didn't have two columns in it (or if there's a trigger on the table, check the DML being fired recursively in those for the same problem).
eg:
check your table. also you should always put explicit column names on your insert (in case someone adds default or nullable columns later on. i.e. always do:
where
col1col2are your real column names.