Language:

The Free and Open Productivity Suite
Apache OpenOffice 4.1.4 released

Developer's Guide

API

SDK

Tips 'n' Tricks

Miscellaneous


:: com :: sun :: star :: sdb ::

unpublished constants group ErrorCondition
Usage Restrictions
not published
Description
defines error conditions for OpenOffice.org Base core components

Core components of OpenOffice.org will use those error conditions as error codes (::com::sun::star::sdbc::SQLException::ErrorCode) whereever possible.
That is, if an SQLException is raised by such a component, caused by an error condition which is included in the ErrorCondition group, then the respective negative value will be used as ErrorCode.

This allows to determine specific error conditions in your client code, and to handle it appropriately.

Note that before you examine the ErrorCode member of a caught SQLException, you need to make sure that the exception is really thrown by an OpenOffice.org Base core component. To do so, check whether the error message (Exception::Message) starts with the vendor string [OOoBase].

The list of defined error conditions, by nature, is expected to permanently grow, so never assume it being finalized.

Example
Java
 catch ( SQLException e )
 {
   if ( e.Message.startsWith( "[OOoBase]" ) )
     if ( e.ErrorCode + ErrorCondition.SOME_ERROR_CONDITION == 0 )
       handleSomeErrorCondition();
 }
 

Constants
ROW_SET_OPERATION_VETOED is used by and RowSet to indicate that an operation has been vetoed by one of its approval listeners  
PARSER_CYCLIC_SUB_QUERIES indicates that while parsing an SQL statement, cyclic sub queries have been detected.  
DB_OBJECT_NAME_WITH_SLASHES indicates that the name of a client side database object - a query, a form, or a report - contains one or more slashes, which is forbidden.  
DB_INVALID_SQL_NAME indicates that an identifier is not SQL conform.  
DB_QUERY_NAME_WITH_QUOTES indicates that the name of a query contains quote characters.  
DB_OBJECT_NAME_IS_USED indicates that an attempt was made to save a database object under a name which is already used in the database.  
DB_NOT_CONNECTED indicates an operation was attempted which needs a connection to the database, which did not exist at that time.  
AB_ADDRESSBOOK_NOT_FOUND used by the component implementing address book access to indicate that a requested address book could not be accessed.  
DATA_CANNOT_SELECT_UNFILTERED used to indicate that a SELECT operation on a table needs a filter.  
Constants' Details
ROW_SET_OPERATION_VETOED
const long ROW_SET_OPERATION_VETOED = 100;
Description
is used by and RowSet to indicate that an operation has been vetoed by one of its approval listeners

This error condition results in raising a RowSetVetoException.

See also
RowSet, XRowSetApproveBroadcaster, XRowSetApproveListener
PARSER_CYCLIC_SUB_QUERIES
const long PARSER_CYCLIC_SUB_QUERIES = 200;
Description
indicates that while parsing an SQL statement, cyclic sub queries have been detected.

Imagine you have a client-side query SELECT * FROM table, which is saved as "query1". Additionally, there is a query "query2" defined as SELECT * FROM query1. Now if you try to change the statement of ::query1 to SELECT * FROM query2, this is prohibited, because it would lead to a cyclic sub query.

DB_OBJECT_NAME_WITH_SLASHES
const long DB_OBJECT_NAME_WITH_SLASHES = 300;
Description
indicates that the name of a client side database object - a query, a form, or a report - contains one or more slashes, which is forbidden.
DB_INVALID_SQL_NAME
const long DB_INVALID_SQL_NAME = 301;
Description
indicates that an identifier is not SQL conform.
DB_QUERY_NAME_WITH_QUOTES
const long DB_QUERY_NAME_WITH_QUOTES = 302;
Description
indicates that the name of a query contains quote characters.

This error condition is met when the user attempts to save a query with a name which contains one of the possible database quote characters. This is an error since query names can potentially be used in SELECT statements, where quote identifiers would render the statement invalid.

See also
::com::sun::star::sdb::tools::XDataSourceMetaData::supportsQueriesInFrom
DB_OBJECT_NAME_IS_USED
const long DB_OBJECT_NAME_IS_USED = 303;
Description
indicates that an attempt was made to save a database object under a name which is already used in the database.

In databases which support query names to appear in SELECT statements, this could mean that a table was attempted to be saved with the name of an existing query, or vice versa.

Otherwise, it means an object was attempted to be saved with the name of an already existing object of the same type.

See also
::com::sun::star::sdb::application::DatabaseObject, ::com::sun::star::sdb::tools::XDataSourceMetaData::supportsQueriesInFrom
DB_NOT_CONNECTED
const long DB_NOT_CONNECTED = 304;
Description
indicates an operation was attempted which needs a connection to the database, which did not exist at that time.
AB_ADDRESSBOOK_NOT_FOUND
const long AB_ADDRESSBOOK_NOT_FOUND = 500;
Description
used by the component implementing address book access to indicate that a requested address book could not be accessed.

For instance, this error code is used when you try to access the address book in a Thunderbird profile named MyProfile, but there does not exist a profile with this name.

DATA_CANNOT_SELECT_UNFILTERED
const long DATA_CANNOT_SELECT_UNFILTERED = 550;
Description
used to indicate that a SELECT operation on a table needs a filter.

Some database drivers are not able to SELECT from a table if the statement does not contain a WHERE clause. In this case, a statement like SELECT * FROM "table" with fail with the error code DATA_CANNOT_SELECT_UNFILTERED.

It is also legitimate for the driver to report this error condition as warning, and provide an empty result set, instead of ungracefull failing.

Top of Page

Apache Software Foundation

Copyright & License | Privacy | Contact Us | Donate | Thanks

Apache and the Apache feather logo are trademarks of The Apache Software Foundation. OpenOffice, OpenOffice.org and the seagull logo are registered trademarks of The Apache Software Foundation. Other names appearing on the site may be trademarks of their respective owners.