Describes a database connection, which is required to initiate database operations.
public interface Connection
All members of the Connection interface, including all inherited members.
Name | Description |
---|---|
Cancels any waitForEvent calls on this Connection object. | |
Changes the database encryption key for an UltraLite database. | |
Commits the database changes. | |
Creates a new DecimalNumber object. | |
Creates a set of synchronization parameters. | |
Creates a UUID value. | |
Drops a database. | |
Performs an emergency shut down of a connected database. | |
Returns the value of database ID. | |
Returns a DataInfo object containing information about database properties. | |
Returns a database property. | |
Returns the time of the most recent download of the specified publication. | |
Retrieves the most recent value inserted into a DEFAULT AUTOINCREMENT or DEFAULT GLOBAL AUTOINCREMENT column, or zero if the most recent INSERT transaction was made on a table that had no such column. | |
Returns information about the last SQL statement executed on this connection. | |
Returns a database option. | |
Returns the state of the connection. | |
Returns the SyncObserver object that is currently registered for this Connection object. | |
Returns the result of the last SYNCHRONIZE SQL statement. | |
Determine if the synchronization of deletes is disabled. | |
Prepares a statement for execution. | |
Registers a system event to receive notifications. | |
Releases this connection. | |
Resets the time of the download for the specified publications. | |
Commits a rollback to undo changes to the database. | |
Rolls back the changes from a failed synchronization. | |
Sets the database ID for global autoincrement. | |
Sets the database option. | |
Sets a SyncObserver object to monitor the progress of synchronizations on this connection. | |
Synchronizes the database with a MobiLink server. | |
Unregisters from a system event to stop receiving notifications. | |
Validates the database on this connection. | |
Waits for an event notification. | |
Denotes a connected state. | |
Denotes a not connected state. | |
Database option: blob file base dir. | |
Database option: database id. | |
Database option: date format. | |
Database option: date order. | |
Database option: maximum hash size. | |
Database option: ML remote ID. | |
Database option: MobiLink server protocol version. | |
Database option: nearest century. | |
Database option: precision. | |
Database option: scale. | |
Database option: time format. | |
Database option: timestamp format. | |
Database option: timestamp increment. | |
Database option: timestamp with time zone format. | |
Database Property: database name. | |
Database Property: page size. | |
The publication list used to request synchronization of all tables in the database, including tables not in any publication. | |
The reserved name of the SYNC_ALL_DB publication. | |
The publication list used to request synchronization of all publications in the database. | |
Used to validate database. | |
Used to perform a faster, though less thorough, validation. | |
Performs all types of validation on the database. | |
Used to validate indexes. | |
Used to validate table(s). |
A connection is obtained using the connect or createDatabase methods of the DatabaseManager class. Use the release method when the connection is no longer needed. When all connections for a database are released, the database is closed.
A Connection object provides the following capabilities:
Create new schema (tables, indexes and publications)
Create new value and domain objects
Permanently commit changes to the database
Prepare SQL statements for execution
Roll back uncommitted changes to the database
The following example demonstrates how to create a schema for a simple database with a Connection object, conn, created for it. The database contains a table named T1, which has a single integer primary key column named num, and a table named T2, which has an integer primary key column named num and an integer column named quantity. T2 has an addition index on quantity. A publication named PubA contains T1.
// Assumes a valid connection object, conn, for the current database. PreparedStatement ps; ps = conn.prepareStatement( "CREATE TABLE T1 ( num INT NOT NULL PRIMARY KEY )" ); ps.execute(); ps.close(); ps = conn.prepareStatement( "CREATE TABLE T2 ( num INT NOT NULL PRIMARY KEY, quantity INT)" ); ps.execute(); ps.close(); ps = conn.prepareStatement( "CREATE INDEX index1 ON T2( quantity )" ); ps.execute(); ps.close(); ps = conn.prepareStatement( "CREATE Publication PubA ( Table T1 )" ); ps.execute(); ps.close(); |
cancelWaitForEvent method [Android]
changeEncryptionKey method
commit method
createDecimalNumber method
createSyncParms method
createUUIDValue method
dropDatabase method
emergencyShutdown method [BlackBerry]
getDatabaseId method [BlackBerry]
getDatabaseInfo method
getDatabaseProperty method
getLastDownloadTime method
getLastIdentity method
getLastWarning method
getOption method [BlackBerry]
getState method
getSyncObserver method
getSyncResult method
isSynchronizationDeleteDisabled method [BlackBerry]
prepareStatement method
registerForEvent method [Android]
release method
resetLastDownloadTime method
rollback method
rollbackPartialDownload method [Android]
setDatabaseId method
setOption method
setSyncObserver method
synchronize method
unregisterForEvent method [Android]
validateDatabase method [Android]
waitForEvent method [Android]
CONNECTED variable
NOT_CONNECTED variable
OPTION_BLOB_FILE_BASE_DIR variable [BlackBerry]
OPTION_DATABASE_ID variable [BlackBerry]
OPTION_DATE_FORMAT variable
OPTION_DATE_ORDER variable
OPTION_MAX_HASH_SIZE variable
OPTION_ML_REMOTE_ID variable [BlackBerry]
OPTION_ML_SERVER_VERSION variable [BlackBerry]
OPTION_NEAREST_CENTURY variable
OPTION_PRECISION variable
OPTION_SCALE variable
OPTION_TIME_FORMAT variable
OPTION_TIMESTAMP_FORMAT variable
OPTION_TIMESTAMP_INCREMENT variable
OPTION_TIMESTAMP_WITH_TIME_ZONE_FORMAT variable
PROPERTY_DATABASE_NAME variable
PROPERTY_PAGE_SIZE variable
SYNC_ALL variable
SYNC_ALL_DB_PUB_NAME variable
SYNC_ALL_PUBS variable
ULVF_DATABASE variable [Android]
ULVF_EXPRESS variable [Android]
ULVF_FULL_VALIDATE variable [Android]
ULVF_INDEX variable [Android]
ULVF_TABLE variable [Android]
![]() |
Discuter à propos de cette page dans DocCommentXchange.
|
Copyright © 2013, SAP AG ou société affiliée SAP - SAP Sybase SQL Anywhere 16.0 |