Describes a database connection, which is required to initiate database operations.
public interface Connection
All members of Connection interface, including all inherited members.
Name | Description |
---|---|
Checkpoints the database changes. | |
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 on 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 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. | |
Releases this connection. | |
Resets the time of the download for the specified publications. | |
Commits a rollback to undo changes to the database. | |
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. | |
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: ML remote ID. | |
Database option: nearest century. | |
Database option: precision. | |
Database option: scale. | |
Database option: time format. | |
Database option: timestamp format. | |
Database option: timestamp increment. | |
OPTION_TIMESTAMP_WITH_TIME_ZONE_FORMAT variable [BlackBerry] |
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. |
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(); |
checkpoint 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
getOption method [BlackBerry]
getState method [BlackBerry]
getSyncObserver method
getSyncResult method
isSynchronizationDeleteDisabled method [BlackBerry]
prepareStatement method
release method
resetLastDownloadTime method
rollback method
setDatabaseId method
setOption method
setSyncObserver method
synchronize method
CONNECTED variable
NOT_CONNECTED variable
OPTION_BLOB_FILE_BASE_DIR variable [BlackBerry]
OPTION_DATABASE_ID variable [BlackBerry]
OPTION_DATE_FORMAT variable [BlackBerry]
OPTION_DATE_ORDER variable [BlackBerry]
OPTION_ML_REMOTE_ID variable [BlackBerry]
OPTION_NEAREST_CENTURY variable [BlackBerry]
OPTION_PRECISION variable [BlackBerry]
OPTION_SCALE variable [BlackBerry]
OPTION_TIME_FORMAT variable [BlackBerry]
OPTION_TIMESTAMP_FORMAT variable [BlackBerry]
OPTION_TIMESTAMP_INCREMENT variable [BlackBerry]
OPTION_TIMESTAMP_WITH_TIME_ZONE_FORMAT variable [BlackBerry]
PROPERTY_DATABASE_NAME variable [BlackBerry]
PROPERTY_PAGE_SIZE variable [BlackBerry]
SYNC_ALL variable
SYNC_ALL_DB_PUB_NAME variable
SYNC_ALL_PUBS variable
Discuss this page in DocCommentXchange.
|
Copyright © 2012, iAnywhere Solutions, Inc. - SQL Anywhere 12.0.1 |