org.sql2o.Query.getConnection()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(5.7k)|赞(0)|评价(0)|浏览(118)

本文整理了Java中org.sql2o.Query.getConnection方法的一些代码示例,展示了Query.getConnection的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Query.getConnection方法的具体详情如下:
包路径:org.sql2o.Query
类名称:Query
方法名:getConnection

Query.getConnection介绍

暂无

代码示例

代码示例来源:origin: aaberg/sql2o

/**
 * Read a collection lazily. Generally speaking, this should only be used if you are reading MANY
 * results and keeping them all in a Collection would cause memory issues. You MUST call
 * {@link org.sql2o.ResultSetIterable#close()} when you are done iterating.
 *
 * @param resultSetHandlerFactory factory to provide ResultSetHandler
 * @return iterable results
 */
public <T> ResultSetIterable<T> executeAndFetchLazy(final ResultSetHandlerFactory<T> resultSetHandlerFactory) {
  final Quirks quirks = getConnection().getSql2o().getQuirks();
  return new ResultSetIterableBase<T>() {
    public Iterator<T> iterator() {
      return new PojoResultSetIterator<>(rs, isCaseSensitive(), quirks, resultSetHandlerFactory);
    }
  };
}

代码示例来源:origin: aaberg/sql2o

@Override
  public void setParameter(int paramIdx, PreparedStatement statement) throws SQLException {
    getConnection().getSql2o().getQuirks().setParameter(statement, paramIdx, value);
  }
});

代码示例来源:origin: aaberg/sql2o

@Override
  public void setParameter(int paramIdx, PreparedStatement statement) throws SQLException {
    getConnection().getSql2o().getQuirks().setParameter(statement, paramIdx, value);
  }
});

代码示例来源:origin: aaberg/sql2o

@Override
  public void setParameter(int paramIdx, PreparedStatement statement) throws SQLException {
    getConnection().getSql2o().getQuirks().setParameter(statement, paramIdx, value);
  }
});

代码示例来源:origin: aaberg/sql2o

@Override
  public void setParameter(int paramIdx, PreparedStatement statement) throws SQLException {
    if(values.length == 0) {
      getConnection().getSql2o().getQuirks().setParameter(statement, paramIdx, (Object) null);
    } else {
      for (Object value : values) {
        getConnection().getSql2o().getQuirks().setParameter(statement, paramIdx++, value);
      }
    }
  }
});

代码示例来源:origin: aaberg/sql2o

public void setParameter(int paramIdx, PreparedStatement statement) throws SQLException {
    getConnection().getSql2o().getQuirks().setParameter(statement, paramIdx, value);
  }
});

代码示例来源:origin: aaberg/sql2o

public void setParameter(int paramIdx, PreparedStatement statement) throws SQLException {
    getConnection().getSql2o().getQuirks().setParameter(statement, paramIdx, value);
  }
});

代码示例来源:origin: aaberg/sql2o

public void setParameter(int paramIdx, PreparedStatement statement) throws SQLException {
    getConnection().getSql2o().getQuirks().setParameter(statement, paramIdx, value);
  }
});

代码示例来源:origin: aaberg/sql2o

public void setParameter(int paramIdx, PreparedStatement statement) throws SQLException {
    getConnection().getSql2o().getQuirks().setParameter(statement, paramIdx, value);
  }
});

代码示例来源:origin: aaberg/sql2o

public void setParameter(int paramIdx, PreparedStatement statement) throws SQLException {
    getConnection().getSql2o().getQuirks().setParameter(statement, paramIdx, convertedValue);
  }
});

代码示例来源:origin: aaberg/sql2o

public void setParameter(int paramIdx, PreparedStatement statement) throws SQLException {
    getConnection().getSql2o().getQuirks().setParameter(statement, paramIdx, value);
  }
});

代码示例来源:origin: aaberg/sql2o

public void setParameter(int paramIdx, PreparedStatement statement) throws SQLException {
    getConnection().getSql2o().getQuirks().setParameter(statement, paramIdx, value);
  }
});

代码示例来源:origin: aaberg/sql2o

public void setParameter(int paramIdx, PreparedStatement statement) throws SQLException {
    getConnection().getSql2o().getQuirks().setParameter(statement, paramIdx, value);
  }
});

代码示例来源:origin: aaberg/sql2o

public void setParameter(int paramIdx, PreparedStatement statement) throws SQLException {
    getConnection().getSql2o().getQuirks().setParameter(statement, paramIdx, value);
  }
});

代码示例来源:origin: aaberg/sql2o

public Iterator<Row> iterator() {
    return new TableResultSetIterator(rs, isCaseSensitive(), getConnection().getSql2o().getQuirks(), lt);
  }
});

代码示例来源:origin: aaberg/sql2o

private <T> ResultSetHandlerFactory<T> newResultSetHandlerFactory(Class<T> returnType) {
  final Quirks quirks = getConnection().getSql2o().getQuirks();
  ResultSetHandlerFactoryBuilder builder = getResultSetHandlerFactoryBuilder();
  if(builder==null) builder=new DefaultResultSetHandlerFactoryBuilder();
  builder.setAutoDeriveColumnNames(this.autoDeriveColumnNames);
  builder.setCaseSensitive(this.caseSensitive);
  builder.setColumnMappings(this.getColumnMappings());
  builder.setQuirks(quirks);
  builder.throwOnMappingError(this.throwOnMappingFailure);
  return builder.newFactory(returnType);
}

代码示例来源:origin: org.sql2o/sql2o

public void setParameter(int paramIdx, PreparedStatement statement) throws SQLException {
    getConnection().getSql2o().getQuirks().setParameter(statement, paramIdx, value);
  }
});

代码示例来源:origin: org.sql2o/sql2o

@Override
  public void setParameter(int paramIdx, PreparedStatement statement) throws SQLException {
    getConnection().getSql2o().getQuirks().setParameter(statement, paramIdx, value);
  }
});

代码示例来源:origin: org.sql2o/sql2o

@Override
  public void setParameter(int paramIdx, PreparedStatement statement) throws SQLException {
    if(values.length == 0) {
      getConnection().getSql2o().getQuirks().setParameter(statement, paramIdx, (Object) null);
    } else {
      for (Object value : values) {
        getConnection().getSql2o().getQuirks().setParameter(statement, paramIdx++, value);
      }
    }
  }
});

代码示例来源:origin: org.sql2o/sql2o

private <T> ResultSetHandlerFactory<T> newResultSetHandlerFactory(Class<T> returnType) {
  final Quirks quirks = getConnection().getSql2o().getQuirks();
  ResultSetHandlerFactoryBuilder builder = getResultSetHandlerFactoryBuilder();
  if(builder==null) builder=new DefaultResultSetHandlerFactoryBuilder();
  builder.setAutoDeriveColumnNames(this.autoDeriveColumnNames);
  builder.setCaseSensitive(this.caseSensitive);
  builder.setColumnMappings(this.getColumnMappings());
  builder.setQuirks(quirks);
  builder.throwOnMappingError(this.throwOnMappingFailure);
  return builder.newFactory(returnType);
}

相关文章