JavaXT

Connection Class

Used to connect to a database via JDBC

Constructors

public Connection( )
public Connection( java.sql.Connection conn )

Methods

close( ) returns void
Used to close a connection to the database, freeing up connections
commit( ) returns void
Used to explicitely commit changes made to the database.
execute( String sql ) returns void
Used to execute a prepared sql statement (e.g. "delete from my_table").
getConnection( ) returns java.sql.Connection
Used to retrieve the java.sql.Connection for this Connection
getConnectionSpeed( ) returns long
Used to retrieve the time it took to open the database connection (in milliseconds)
getDatabase( ) returns javaxt.sql.Database
Used to return database information associated with this connection.
isClosed( ) returns boolean
Used to determine whether the connection is closed.
isOpen( ) returns boolean
Used to determine whether the connection is open.
open( String ConnectionString ) returns boolean
Used to open a connection to the database.
ConnectionStringA jdbc connection string/url. All connection URLs have the following form:
 jdbc:[dbVendor]://[dbName][propertyList] 
Example:
 jdbc:derby://temp/my.db;user=admin;password=mypassword 
open( javaxt.sql.Database database ) returns boolean
Used to open a connection to the database.
open( java.sql.Connection conn ) returns boolean
Used to open a connection to the database using a JDBC Connection. This is particularly useful when using JDBC connection pools.