JavaXT

Database Class

Object used to represent all of the information required to connect to a database.

Constructors

public Database( )
public Database( String name, String host, int port, String username, String password, javaxt.sql.Driver driver )
public Database( java.sql.Connection conn )
public Database( String connStr )

Methods

clone( ) returns javaxt.sql.Database
displayDbProperties( javaxt.sql.Connection conn ) returns void
getCatalogs( javaxt.sql.Connection conn ) returns String[]
Used to retrieve a list of available databases found on this server.
getConnection( ) returns javaxt.sql.Connection
Used to open a connection to the database. Note the the connection will need to be closed afterwards.
getConnectionPoolDataSource( ) returns javax.sql.ConnectionPoolDataSource
Used to instantiate a ConnectionPoolDataSource for the database. The ConnectionPoolDataSource is typically used to create a JDBC Connection Pool.
getConnectionString( ) returns String
Returns a JDBC connection string used to connect to the database. Username and password are appended to the end of the url.
getDriver( ) returns javaxt.sql.Driver
getHost( ) returns String
Returns the name or IP address of the server or a physical path to the database file.
getName( ) returns String
Gets the name of the catalog used to store tables, views, etc.
getPassword( ) returns String
getPort( ) returns int
getProperties( ) returns java.util.Properties
getReservedKeywords( javaxt.sql.Connection conn ) returns String[]
Used to retrieve a list of reserved keywords for a given database.
getTables( javaxt.sql.Connection conn ) returns javaxt.sql.Table[]
Used to retrieve an array of tables found in this database.
getUserName( ) returns String
setConnectionPoolDataSource( javax.sql.ConnectionPoolDataSource dataSource ) returns void
Used to set the ConnectionPoolDataSource for the database. Typically, the getConnectionPoolDataSource() method is used to create a ConnectionPoolDataSource. This method allows you to specify a different ConnectionPoolDataSource.
setDriver( javaxt.sql.Driver driver ) returns void
setDriver( String driver ) returns void
Used to find a driver that corresponds to a given vendor name, class name, or protocol.
setDriver( java.sql.Driver driver ) returns void
setDriver( Class driver ) returns void
setHost( String host ) returns void
Used to set the path to the database.
hostServer name/port (e.g. localhost:9080) or a path to a file (e.g. /temp/firebird.db)
setHost( String host, int port ) returns void
Used to set the path to the database (server name and port).
setName( String name ) returns void
Sets the name of the catalog used to store tables, views, etc.
setPassword( String password ) returns void
setPort( int port ) returns void
setProperties( java.util.Properties properties ) returns void
setUserName( String username ) returns void
toString( ) returns String
Returns database connection information encapsulated by this class.