Why do I keep getting the error "java.lang.AbstractMethodError: oracle.jdbc.driver.OracleConnection"? It made me rave.,

I already read. Why am I getting java.lang.AbstractMethodError when trying to load blob in db? , downloaded all the jgbc 11g drivers that I could find, and added them as libraries and / or jar files to my NetBeans application. I still keep getting the same AbstractMethodError and it makes me lie low! Any guidance would be greatly appreciated!

try {

    stmt = conn.createStatement();
    inputFileInputStream = new FileInputStream(inputBinaryFile);  

    Blob vBlob = conn.createBlob();
    BufferedImage vGImage=ImageIO.read(name);
    int offset =0;
    OutputStream out = vBlob.setBinaryStream(offset);
    ImageIO.write(vGImage, "JPG", out);
    PreparedStatement stat = conn.prepareStatement("INSERT INTO item VALUES (?,?,?,?,?)");
    stat.setString(1, itemNo);
    stat.setString(2, itemName);
    stat.setBlob(3,vBlob);
    stat.setString(4, invenType);
    stat.setDouble(5, vPrice);
    stat.executeUpdate();

} catch (IOException e) {
    System.out.println("Caught I/O Exception: (Write BLOB value - Put Method).");
    e.printStackTrace();
    throw e;
} catch (SQLException e) {
    System.out.println("Caught SQL Exception: (Write BLOB value - Put Method).");
    System.out.println("SQL:\n" + sqlText);
    e.printStackTrace();
    throw e;
}finally {
    conn.close();
}  

Error message:

Exception in thread "main" java.lang.AbstractMethodError:                        
oracle.jdbc.driver.OracleConnection.createBlob()Ljava/sql/Blob;
    at DatabaseIO.setOracleDBBlob(DatabaseIO.java:115)
    at DatabaseIO.main(DatabaseIO.java:26)
+5
source share
2 answers

The cause of the problem is incompatible software (jar files).

createBlob - ( java 1.6), .

, , . (, )

+10

, JDBC Oracle.

ojdbc14.jar (Oracle JDBC- 10.1.0.5.0) ojdbc16.jar (Oracle JDBC- 11.2.0.4.0).

+2

All Articles