|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--jasp.adodb.Connection
This class is compatible with Microsoft's ADODB.CONNECTOIN object.
For more usage information, please refer to Microsoft's documention.
A Connection object represents a unique session with a RDBMS.
In the case of a client/server database system, it may be equivalent to
an actual network connection to the server. Depending on the functionality
supported by the JDBC Driver, some collections, methods, or properties of a
Connection object may not be available.
Connection allows you to access database through JDBC Driver.
Use the following syntax to set the ConnectionString.
Constructor Summary | |
Connection()
Creates a Connection Object. |
Method Summary | |
void |
AssignProps()
Assign all properties of the Connection. |
int |
BeginTrans()
Begins a new transaction. |
void |
Cancel()
Terminates execution of an asynchronous Open method. |
void |
Close()
Close the Connection session with database also close any active Recordset object associated with the connection.A Command object associated with the Connection object you are closing will persist, but it will no longer be associated with a Connection object; that is, its ActiveConnection property will be set to Nothing. |
void |
CommitTrans()
Saves changes made within an open transaction on the connection and ends the transaction. |
Recordset |
Execute(java.lang.String CommandText)
Returns a Recordset object with the specific CommandText, the CommandText maybe a SQL statement,stored procedure etc. |
Recordset |
Execute(java.lang.String CommandText,
variant AffectedCount)
Returns a Recordset object with the specific CommandText and return the Affected records number, the CommandText maybe a SQL statement,stored procedure etc. |
Recordset |
Execute(java.lang.String CommandText,
variant AffectedCount,
int Option)
Returns a Recordset object with the specific CommandText and return the Affected records number, the CommandText maybe a SQL statement,stored procedure etc. |
int |
getAttributes()
Returns one or more characteristics. |
int |
getCommandTimeout()
Returns how long to wait while executing a command before terminating the attempt and generating an error. |
java.lang.String |
getConnectionString()
Returns the information used to establish a connection to a data source. |
int |
getConnectionTimeout()
Returns the value of ConnectionTimeout with current object's |
java.lang.String |
getConnectURL()
Returns the url of the connection. |
int |
getCursorLocation()
Returns the location of cursor engine. |
java.lang.String |
getDefaultDatabase()
Returns a string value that evaluates to the name of a database available from the provider. |
Errors |
getErrors()
Returns the Errors collection |
Error |
getErrors(int i)
Gets an Error from the Errors Collection. |
Error |
getErrors(java.lang.String i)
|
int |
getIsolationLevel()
Returns the level of isolation for a Connection object. |
int |
getMode()
Returns the available permissions for modifying data in a Connection. |
int |
getObjectState()
Returns the objectstate of the Connection. |
java.lang.String |
getPassword()
Returns the Password of the user name. |
Properties |
getProperties()
Returns the properties collection of the Connection. |
java.lang.String |
getProvider()
Returns the name of the Jdbc driver. |
int |
getState()
Returns states of all applicable objects, open or closed. |
java.lang.String |
getUserName()
Returns the user name for conecting database |
java.lang.String |
getVersion()
Returns the currect the version of the ADODB. |
void |
Open()
Opens a connection to a data source. |
void |
Open(java.lang.String connectStr)
Opens a connection to a data source. |
void |
Open(java.lang.String connectStr,
java.lang.String UserID)
Opens a connection to a data source. |
void |
Open(java.lang.String connectStr,
java.lang.String UserID,
java.lang.String Password)
Opens a connection to a data source. |
void |
Open(java.lang.String connectStr,
java.lang.String UserID,
java.lang.String Password,
int Option)
Opens a connection to a data source. |
void |
Open(java.lang.String connectStr,
variant UserID,
java.lang.String Password)
Opens a connection to a data source. |
void |
Open(variant connectStr,
java.lang.String UserID,
java.lang.String Password,
int Option)
Opens a connection to a data source. |
void |
Open(variant connectStr,
variant UserID,
java.lang.String Password,
int Option)
Opens a connection to a data source. |
void |
Open(variant connectStr,
variant UserID,
variant Password,
int Option)
Opens a connection to a data source. |
Recordset |
OpenSchema(int QueryType)
Returns a Recordset object that Obtains database schema information from the provider. |
Recordset |
OpenSchema(int QueryType,
variant Criteria)
Returns a Recordset object that Obtains database schema information from the provider. |
Recordset |
OpenSchema(int QueryType,
variant Criteria,
java.lang.Object SchemaID)
Returns a Recordset object that Obtains database schema information from the provider. |
Property |
Properties(int index)
Gets a property with specific index from Properties collection |
Property |
Properties(java.lang.String name)
Returns the Property object with specific name from Properties collection |
Property |
Properties(variant var)
Gets a property from the Properties collection. |
void |
RollbackTrans()
Reverses any changes made within an open transaction and ends the transaction if the Attributes property is set to adXactAbortRetaining, it automatically starts a new transaction after a RollbackTrans call |
void |
setAttributes(int attrib)
Indicates one or more characteristics of an object. |
void |
setCommandTimeout(int cmdtimeout)
Sets the CommandTimeout property value |
void |
setConnectionString(java.lang.String connectStr)
Sets the information for establish a connection Note: the connection must be following format: Using jdbc-odbc bridge: "DSN=Data Source Name;UID=userid;PWD=password" Using JDBC Drivers: "Driver=drivername;URL={JDBC url};UserID=userid;Password=password;" |
void |
setConnectionTimeout(int timeout)
Sets the ConnectionTimeout's value for the currect object. |
void |
setConnectURL(java.lang.String url)
Sets the url of the Connection |
void |
setCursorLocation(int cursorlocation)
Sets the location of the cursor engine. |
void |
setDefaultDatabase(java.lang.String db)
Sets a string value the evaluates to the name of a database avaliable from the provider. |
void |
setIsolationLevel(int islevel)
Sets the level of isolation for a Connection object. |
void |
setMode(int mode)
Sets the available permissions for connection. |
void |
setPassword(java.lang.String password)
Sets the password of the username. |
void |
setProvider(java.lang.String provider)
Sets the name of jdbc driver. |
void |
setUserName(java.lang.String username)
Set the user name for conecting database. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public Connection()
Method Detail |
public java.lang.String getVersion() throws java.lang.Exception
public void setConnectURL(java.lang.String url) throws java.lang.Exception
url
- the url of JDBC Driver for connecting database.public java.lang.String getConnectURL()
public void setUserName(java.lang.String username) throws java.lang.Exception
public java.lang.String getUserName()
public java.lang.String getPassword()
public void setPassword(java.lang.String password) throws java.lang.Exception
public java.lang.String getDefaultDatabase() throws java.lang.Exception
public void setDefaultDatabase(java.lang.String db) throws java.lang.Exception
public int getConnectionTimeout()
public void setConnectionTimeout(int timeout) throws java.lang.Exception
public int getState()
public int getMode()
public void setMode(int mode) throws java.lang.Exception
public java.lang.String getProvider()
public void setProvider(java.lang.String provider) throws java.lang.Exception
public int getAttributes()
public void setAttributes(int attrib)
public int getCursorLocation()
public void setCursorLocation(int cursorlocation) throws java.lang.Exception
public int getCommandTimeout()
public void setCommandTimeout(int cmdtimeout)
public java.lang.String getConnectionString()
public void setConnectionString(java.lang.String connectStr) throws java.lang.Exception
connectStr
- a string valuepublic int getIsolationLevel()
public void setIsolationLevel(int islevel)
public Properties getProperties() throws java.lang.Exception
public int getObjectState()
public void AssignProps() throws java.lang.Exception
public Property Properties(variant var) throws java.lang.Exception
var
- the name or index of the property.public Property Properties(int index) throws java.lang.Exception
index
- the index of the property.public Property Properties(java.lang.String name) throws java.lang.Exception
name
- the name of the property.public Errors getErrors()
public Error getErrors(int i) throws java.lang.Exception
i
- the index of the error.public Error getErrors(java.lang.String i) throws java.lang.Exception
public Recordset OpenSchema(int QueryType) throws java.lang.Exception
QueryType
- The type of schema query to run.public Recordset OpenSchema(int QueryType, variant Criteria, java.lang.Object SchemaID) throws java.lang.Exception
QueryType
- The type of schema query to run.Criteria
- An array of query constraints for each QueryType option.SchemaID
- The GUID for a provider-schema schema query not defined by the OLE DB
specification.(Don't use it in J-ASP).public Recordset OpenSchema(int QueryType, variant Criteria) throws java.lang.Exception
QueryType
- The type of schema query to run.Criteria
- An array of query constraints for each QueryType option.public void Close() throws java.lang.Exception
public Recordset Execute(java.lang.String CommandText) throws java.lang.Exception
CommandText
- A String containing the SQL statement,
table name, stored procedure, or provider-specific
text to executepublic Recordset Execute(java.lang.String CommandText, variant AffectedCount) throws java.lang.Exception
CommandText
- A String containing the SQL statement, table name, stored procedure,
or provider-specific text to executeAffectedCount
- the provider returns the number of records that the operation affected.public Recordset Execute(java.lang.String CommandText, variant AffectedCount, int Option) throws java.lang.Exception
CommandText
- A String containing the SQL statement, table name, stored procedure,
or provider-specific text to executeAffectedCount
- the provider returns the number of records that the operation affected.Option
- An integer value that indicates how the provider should evaluate the CommandText argument.public void Open() throws java.lang.Exception
public void Open(java.lang.String connectStr) throws java.lang.Exception
connectStr
- A String containing connection information. See the
ConnectionString property for details on valid settingspublic void Open(java.lang.String connectStr, java.lang.String UserID) throws java.lang.Exception
connectStr
- A String containing connection information. See the
ConnectionString property for details on valid settingsUserID
- A String containing a user name to use when establishing
the connection.public void Open(java.lang.String connectStr, java.lang.String UserID, java.lang.String Password) throws java.lang.Exception
connectStr
- A String containing connection information. See the
ConnectionString property for details on valid settingsUserID
- A String containing a user name to use when establishing
the connection.Password
- A String containing a password to use when establishing the connection.public void Open(java.lang.String connectStr, variant UserID, java.lang.String Password) throws java.lang.Exception
connectStr
- A String containing connection information. See the
ConnectionString property for details on valid settingsUserID
- A variant containing a user name to use when establishing
the connection.Password
- A String containing a password to use when establishing the connection.public void Open(variant connectStr, variant UserID, variant Password, int Option) throws java.lang.Exception
connectStr
- A variant containing connection information. See the
ConnectionString property for details on valid settingsUserID
- A variant containing a user name to use when establishing
the connection.Password
- A variant containing a password to use when establishing the connection.public void Open(variant connectStr, variant UserID, java.lang.String Password, int Option) throws java.lang.Exception
connectStr
- A variant containing connection information. See the
ConnectionString property for details on valid settingsUserID
- A variant containing a user name to use when establishing
the connection.Password
- A String containing a password to use when establishing the connection.public void Open(variant connectStr, java.lang.String UserID, java.lang.String Password, int Option) throws java.lang.Exception
connectStr
- A variant containing connection information. See the
ConnectionString property for details on valid settingsUserID
- A String containing a user name to use when establishing
the connection.Password
- A String containing a password to use when establishing the connection.public void Open(java.lang.String connectStr, java.lang.String UserID, java.lang.String Password, int Option) throws java.lang.Exception
connectStr
- A String containing connection information. See the
ConnectionString property for details on valid settingsUserID
- A String containing a user name to use when establishing
the connection.Password
- A String containing a password to use when establishing the connection.public void Cancel()
public int BeginTrans() throws java.lang.Exception
public void CommitTrans() throws java.lang.Exception
public void RollbackTrans() throws java.lang.Exception
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |