The refactorings applied to JDBC are
-
Fixes the class hierarchy of JDBC statement classes:
PreparedStatement,CallableStatementderive fromStatementbut some base methods inherit should not be used by the derived class. E.g. if you use aPreparedStatementthenStatement.executeQuery(String)should not be used. JDBX statement classes only offer methods which are valid to be called. -
Uses the Builder pattern to reduce the size of the crowded APIs of
StatementandResultSet. E.g. all option related methods are pushed into a classStmtOptions. -
JDBC
Statementhas many methods which can only be called if the statement object is in a certain state, e.g.getGeneratedKeys(),getUpdateCount(),getResultSet(). These methods are moved into special result objects so you can only access them when dealing with the result. -
Uses functional interfaces to read the result of a statement execution and therefore reduces repeating boilerplate code.
-
Replaces the checked
java.sql.SQLExceptionby an uncheckedJdbxException. -
Introduces Enums for the
intconstants inStatementandResultSet.