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 new synchronization parameter set. | |
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 property of the database. | |
Returns the time of the most recent download of the specified publication. | |
Retrieves the most recent value inserted into an DEFAULT AUTOINCREMENT or DEFAULT GLOBAL AUTOINCREMENT column, or zero if the most recent insert was into a table that had no such column. | |
Returns a database option. | |
Returns the state of the connection. | |
Returns the currently registered SyncObserver object for this Connection. | |
Returns the result of the last SYNCHRONIZE SQL statement, but not the last Connection.synchronize API call. | |
Determine if 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. | |
A connected state. | |
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. | |
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 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 uncommited changes to the database
checkpoint (update the underlying persistent store with committed changes, rather than just storing the change transactions) the database.
The following example demonstrates how to create a schema for a simple database with a connection, 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
getDatabaseId method
getDatabaseInfo method
getDatabaseProperty method
getLastDownloadTime method
getLastIdentity method
getOption method
getState method
getSyncObserver method
getSyncResult method
isSynchronizationDeleteDisabled method
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
OPTION_DATABASE_ID variable
OPTION_DATE_FORMAT variable
OPTION_DATE_ORDER variable
OPTION_ML_REMOTE_ID variable
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
Discuss this page in DocCommentXchange.
|
Copyright © 2010, iAnywhere Solutions, Inc. - SQL Anywhere 12.0.0 |