Exception in thread “main” java.sql.SQLException: Protocol violation: [1] at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:502) at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:205) at oracle.jdbc.driver.T4C7Ocommoncall.doOLOGOFF(T4C7Ocommoncall.java:64) at oracle.jdbc.driver.T4CConnection.logoff(T4CConnection.java:576) at oracle.jdbc.driver.PhysicalConnection.close(PhysicalConnection.java:5222) at XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX Connection con=createConnection(); Con.close(); Con.commit(); Con.close(); Here, commit() is invoked after the connection is closed, hence the above exception occurred.