Code example for CallableStatement

Methods: registerOutParameter

0
     */ 
    public void registerOut(CallableStatement statement, int index, int colType, int dataType,
                            String dataTypeName) throws SQLException {
 
        try { 
            statement.registerOutParameter(index, dataType);
        } catch (Throwable t) {
            SQLException cause = null;
            SQLException ex = new SQLException("error setting index ["
              + index + "], coltype [" + colType + "], datatype [" + dataType
              + "], datatypename [" + dataTypeName + "]");
 
            if (t instanceof SQLException) {
                cause = (SQLException)t;
            } else { 
                cause = new SQLException(t.getMessage());
            } 
            ex.setNextException(cause);
            throw ex;
        } 
    }