DBIx::DataModel::Statement::JDBC - Statement for interacting with DBD::JDBC


DBIx-DataModel documentation  | view source Contained in the DBIx-DataModel distribution.

Index


NAME

Top

DBIx::DataModel::Statement::JDBC - Statement for interacting with DBD::JDBC

SYNOPSIS

Top

When defining the DBIx::DataModel Schema :

  DBIx::DataModel->Schema("MySchema",
     statementClass => "DBIx::DataModel::Statement::JDBC"
  );

When using the schema:

  my $statement = $source->select(...,
                                  -resultAs => 'statement');

  my $n_rows = $statement->size; # size of result set
  my $row_1 = $statement->next;  # record N° 1;
  $statement->relative(15);      # move down 15 records 
  my $row_16 = $statement->next; # record N° 16
  $statement->beforeFirst;       # back to beginning of result set




DESCRIPTION

Top

Scrollable statement for DBD::JDBC datasources. Provides an interface layer to some JDBC methods on Java ResultSet and Statement objects.

METHODS

Top

Calls to the following Java methods are encapsulated in the statement class. See the JDBC javadoc for details:

getMemberCount

number of members in the resultset.

size

current number of rows in the resultset (may be smaller than memberCount if the resultset was restricted through setMaxRows).

getSQLStatement
getRow

index of the current record in the resultset.

beforeFirst
afterLast
isBeforeFirst
isAfterLast
relative
  $statement->relative($delta)

Move the statement $delta rows from the current position ($delta may be positive or negative).

absolute
  $statement->absolute($row_index)

Move the statement at position $row_index.

setMaxRows
  $statement->setMaxRows($max)

Limits the number of rows in ResultSet. Further rows are silently ignored.


DBIx-DataModel documentation  | view source Contained in the DBIx-DataModel distribution.