Databases Reference
In-Depth Information
S PECIFYING C ONNECTION URL S
The connection URL format used with the Driver
Manager is as follows:
jdbc:datadirect:drivername:
//hostname:port[;property=value[;...]]
where:
drivername is the name of the driver, such as sqlserver .
hostname is the IP address or TCP/IP host name of the server to which you
are connecting.
port is the number of the TCP/IP port.
property=value specifies connection properties. The connection properties
supported by the database driver can be found in the driver's technical docu-
mentation.
Using a JDBC Data Source
A JDBC data source is a Java object—specifically a DataSource object—that
defines connection information needed for a JDBC driver to connect to the data-
base. Each JDBC driver vendor provides its own data source implementation for
this purpose.
The main advantage of using a data source is that it works with the JNDI
naming service, and it is created and managed apart from applications that use it.
Because the connection information is defined outside the application, it requires
minimal effort to reconfigure your infrastructure when a change is made. For
example, if the database is moved to another database server and uses another
port number, the administrator needs only to change the relevant properties of
the data source ( DataSource object). The applications using the database do not
need to change because they only refer to the logical name of the data source.
DataDirect Technologies ships a data source class for each of its JDBC drivers.
Each DataDirect data source class implements the following JDBC interfaces:
javax.sql.DataSource
javax.sql.ConnectionPoolDataSource , which allows your applications to
use connection pooling
Search WWH ::




Custom Search