Databases Reference
In-Depth Information
UseCursorLib=0
Trace=0
TraceFile=odbctrace.out
TraceDll=ODBCHOME/lib/odbctrac.so
Connecting to a Database Using a Connection String
If you want to use a connection string to connect to a database, or if your appli-
cation requires it, you must specify either a DSN (data source name), a File DSN,
or a DSN-less connection in the string. The difference is whether you use the
DSN= , FILEDSN= ,or DRIVER= keyword in the connection string, as described in
the ODBC specification. A DSN or FILEDSN connection string tells the driver
where to find the default connection information. Optionally, you may specify
attribute=value pairs in the connection string to override the default values
stored in the data source. These attribute=value pairs are the specifics of the
connection, such as which database server to connect to and whether the driver
uses connection failover and Kerberos. You can find the connection options sup-
ported by the database driver in the driver's technical documentation.
The DSN connection string has the following form:
DSN=data_source_name[;attribute=value[;attribute=value]...]
The FILEDSN connection string has this form:
FILEDSN=filename.dsn[;attribute=value[;attribute=value]...]
The DSN-less connection string specifies a driver instead of a data source.
You must enter all connection information in the connection string because
there is no data source storing the information.
The DSN-less connection string has the following form:
DRIVER=[{]driver_name[}][;attribute=value[;attribute=value]
...]
JDBC Drivers
After you install the driver, you can connect to the database in one of the follow-
ing ways: with a connection URL through the JDBC Driver Manager or with a
Java Naming Directory Interface (JNDI) data source. The examples we use in this
section are for a DataDirect Technologies JDBC driver.
Search WWH ::




Custom Search