org.skife.jdbi.v2.Query.setMaxFieldSize()方法的使用及代码示例

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

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

Query.setMaxFieldSize介绍

[英]Specify the maimum field size in the result set. This uses the underlying JDBC Statement#setMaxFieldSize(int)
[中]指定结果集中的最大字段大小。它使用底层JDBC语句#setMaxFieldSize(int)

代码示例

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

@Test
public void testFoo() throws Exception
{
  DBI dbi = new DBI("jdbc:h2:mem:" + UUID.randomUUID());
  Handle h = dbi.open();
  h.execute("create table something (id int primary key, name varchar(32))");
  h.attach(BatchInserter.class).insert(new Something(1, "Brian"),
                     new Something(3, "Patrick"),
                     new Something(2, "Robert"));
  QueryReturningQuery qrq = h.attach(QueryReturningQuery.class);
  Query<String> q = qrq.findById(1);
  q.setMaxFieldSize(100);
  assertThat(q.first(), equalTo("Brian"));
  h.close();
}

代码示例来源:origin: org.kill-bill.commons/killbill-jdbi

@Test
public void testFoo() throws Exception
{
  DBI dbi = new DBI("jdbc:h2:mem:" + UUID.randomUUID());
  Handle h = dbi.open();
  h.execute("create table something (id int primary key, name varchar(32))");
  h.attach(BatchInserter.class).insert(new Something(1, "Brian"),
                     new Something(3, "Patrick"),
                     new Something(2, "Robert"));
  QueryReturningQuery qrq = h.attach(QueryReturningQuery.class);
  Query<String> q = qrq.findById(1);
  q.setMaxFieldSize(100);
  assertThat(q.first(), equalTo("Brian"));
  h.close();
}

相关文章