03.07.2015 Views

DataDirect Connect for JDBC User's Guide and ... - Stylus Studio

DataDirect Connect for JDBC User's Guide and ... - Stylus Studio

DataDirect Connect for JDBC User's Guide and ... - Stylus Studio

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

30 Chapter 2 Using <strong>DataDirect</strong> <strong>Connect</strong> <strong>for</strong> <strong>JDBC</strong> Drivers<br />

<strong>Connect</strong>ing Through Data Sources<br />

A <strong>DataDirect</strong> <strong>Connect</strong> <strong>for</strong> <strong>JDBC</strong> data source is a DataSource object<br />

that provides the connection in<strong>for</strong>mation needed to connect to<br />

an underlying database. The main advantage of using a data<br />

source is that it works with the Java Naming Directory Interface<br />

(JNDI) naming service, <strong>and</strong> it is created <strong>and</strong> managed apart from<br />

the applications that use it. Because the connection in<strong>for</strong>mation<br />

is outside of the application, the ef<strong>for</strong>t to reconfigure your<br />

infrastructure when a change is made is minimal. For example, if<br />

the underlying database is moved to another server <strong>and</strong> uses<br />

another port number, the administrator must change only the<br />

relevant properties of the <strong>DataDirect</strong> <strong>Connect</strong> <strong>for</strong> <strong>JDBC</strong> data source<br />

(a DataSource object). The applications using the underlying<br />

database do not need to change because they only refer to the<br />

logical name of the <strong>DataDirect</strong> <strong>Connect</strong> <strong>for</strong> <strong>JDBC</strong> data source.<br />

How Data Sources Are Implemented<br />

<strong>DataDirect</strong> Technologies ships a data source class <strong>for</strong> each<br />

<strong>DataDirect</strong> <strong>Connect</strong> <strong>for</strong> <strong>JDBC</strong> driver. See the appropriate driver<br />

chapter <strong>for</strong> the name of the class.<br />

Each <strong>DataDirect</strong> <strong>Connect</strong> <strong>for</strong> <strong>JDBC</strong> data source class provided<br />

implements the following interfaces defined in the <strong>JDBC</strong> 2.0<br />

Optional Package:<br />

■<br />

■<br />

■<br />

javax.sql.DataSource<br />

javax.sql.<strong>Connect</strong>ionPoolDataSource, which enables you to<br />

implement connection pooling<br />

javax.sql.XADataSource <strong>and</strong> javax.sql.XAData<strong>Connect</strong>ion,<br />

which enable you to implement distributed transactions<br />

through JTA<br />

<strong>DataDirect</strong> <strong>Connect</strong> <strong>for</strong> <strong>JDBC</strong> User’s <strong>Guide</strong> <strong>and</strong> Reference

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!