Top Description Constructors
org.jooq.exception

public Class TooManyRowsException

extends InvalidResultException
Class Inheritance
Imports
java.sql.ResultSet, org.jooq.InsertResultStep, .ResultQuery

Too many rows (more than 1) were returned from a ResultQuery.

Like any other InvalidResultException, this exception indicates to clients that the result was not what they expected, but this does not have any effect on the outcome of the statement producing that result. For instance, if calling ResultQuery#fetchOne() on a SELECT … FOR UPDATE query, or InsertResultStep#fetchOne() on an INSERT statement, the database change will still be executed: the rows will still be locked or inserted.

Performance

Methods throwing TooManyRowsException need to retrieve at most two records from the underlying JDBC ResultSet, which, depending on the java.sql.Statement#getFetchSize() / ResultQuery#fetchSize(int), might incur additional database roundtrips. If this causes problems, ResultQuery#fetchAny() may be preferred.

Author
Lukas Eder

Constructor Summary

AccessConstructor and Description
public
TooManyRowsException()

Constructor for TooManyRowsException.

public
TooManyRowsException(String
the detail message
message
)

Constructor for TooManyRowsException.

Constructor Detail

TooManyRowsExceptionback to summary
public TooManyRowsException()

Constructor for TooManyRowsException.

TooManyRowsExceptionback to summary
public TooManyRowsException(String message)

Constructor for TooManyRowsException.

Parameters
message:String

the detail message