Download Stylus Studio - The World's Best XML Development Environment!


com.ddtek.jdbc.jxtr
Class JXTRDataSource

java.lang.Object
  |
  +--com.ddtek.jdbc.jxtr.JXTRDataSource
All Implemented Interfaces:
javax.sql.ConnectionPoolDataSource, javax.sql.DataSource, javax.naming.Referenceable, java.io.Serializable, javax.sql.XADataSource

public class JXTRDataSource
extends java.lang.Object
implements javax.sql.DataSource, javax.sql.ConnectionPoolDataSource, javax.sql.XADataSource, java.io.Serializable, javax.naming.Referenceable

Implements the different JDBC data source interfaces.

JXTRDataSource implements the different JDBC data source interfaces. Besides all standard JDBC methods, some Connect for SQL/XML specific attributes are implemented.

See Also:
Serialized Form

Constructor Summary
JXTRDataSource(javax.sql.DataSource embeddedDataSource)
          Creates a Connect for SQL/XML data source based on an underlying JDBC data source.
 
Method Summary
 java.lang.String getBinaryEncoding()
          Retrieves the type of encoding for binary values.
 java.sql.Connection getConnection()
          Attempts to establish a connection with the data source that this DataSource object represents.
 java.sql.Connection getConnection(java.lang.String user, java.lang.String password)
          Attempts to establish a connection with the data source that this DataSource object represents.
 java.lang.String getDataSourceName()
          Retrieves the name property for this data source.
 java.lang.String getDescription()
          Retrieves the data source description.
 int getLoginTimeout()
          Gets the maximum time in seconds this data source can wait while attempting to connect to a database.
 java.io.PrintWriter getLogWriter()
          Retrieves the log writer for this DataSource object.
 java.lang.String getNullReplacementValue()
          Retrieves NULL replacement value.
 javax.sql.PooledConnection getPooledConnection()
          Attempts to establish a physical database connection that can be used as a pooled connection.
 javax.sql.PooledConnection getPooledConnection(java.lang.String user, java.lang.String password)
          Attempts to establish a physical database connection that can be used as a pooled connection.
 javax.naming.Reference getReference()
          Retrieves the reference for this data source object.
 java.lang.String getTimestampEncoding()
          Retrieves the timestamp encoding.
 javax.sql.XAConnection getXAConnection()
          Attempts to establish a physical database connection.
 javax.sql.XAConnection getXAConnection(java.lang.String username, java.lang.String password)
          Attempts to establish a physical database connection using the specified user name and password.
 void setBinaryEncoding(java.lang.String val)
          Sets the type of encoding for binary values.
 void setDataSourceName(java.lang.String val)
          Sets the name property for this data source.
 void setDescription(java.lang.String val)
          Sets data source description attribute.
 void setLoginTimeout(int value)
          Sets the maximum time in seconds that this data source will wait while attempting to connect to a database.
 void setLogWriter(java.io.PrintWriter writer)
          Sets the log writer for this DataSource object.
 void setNullReplacementValue(java.lang.String val)
          Sets the replacement value to use if a NULL value is encountered when selecting data from the database.
 void setTimestampEncoding(java.lang.String val)
          Sets the type of encoding for timestamp values.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JXTRDataSource

public JXTRDataSource(javax.sql.DataSource embeddedDataSource)
Creates a Connect for SQL/XML data source based on an underlying JDBC data source.

Parameters:
embeddedDataSource - A valid Connect for JDBC or SequeLink for JDBC data source.
Method Detail

setDataSourceName

public void setDataSourceName(java.lang.String val)
Sets the name property for this data source.

Parameters:
val - The name for this data source.

getDataSourceName

public java.lang.String getDataSourceName()
Retrieves the name property for this data source.

Returns:
String The name property of this data source.

setBinaryEncoding

public void setBinaryEncoding(java.lang.String val)
Sets the type of encoding for binary values.

Either base64 or hex

Parameters:
val - Encoding to use for timestamp values.

getBinaryEncoding

public java.lang.String getBinaryEncoding()
Retrieves the type of encoding for binary values.

Either odbc or iso8601


setTimestampEncoding

public void setTimestampEncoding(java.lang.String val)
Sets the type of encoding for timestamp values.

Parameters:
val - Timestamp encoding

getTimestampEncoding

public java.lang.String getTimestampEncoding()
Retrieves the timestamp encoding.

Returns:
String

setNullReplacementValue

public void setNullReplacementValue(java.lang.String val)
Sets the replacement value to use if a NULL value is encountered when selecting data from the database.

Parameters:
val - Value used to replace the NULL value if a NULL value is encountered.

getNullReplacementValue

public java.lang.String getNullReplacementValue()
Retrieves NULL replacement value.

Returns:
String Value used to replace NULL value if a NULL value is encountered

setDescription

public void setDescription(java.lang.String val)
Sets data source description attribute.

Parameters:
val - Data source description.

getDescription

public java.lang.String getDescription()
Retrieves the data source description.

Returns:
The data source description

getReference

public javax.naming.Reference getReference()
Retrieves the reference for this data source object.

Specified by:
getReference in interface javax.naming.Referenceable
Returns:
Reference The JNDI reference for this data source object.

getLoginTimeout

public int getLoginTimeout()
                    throws java.sql.SQLException
Gets the maximum time in seconds this data source can wait while attempting to connect to a database. A value of zero (0) specifies that there is no timeout. When a DataSource object is created, the login timeout is set to zero initially.

Specified by:
getLoginTimeout in interface javax.sql.DataSource
Returns:
The data source timeout.
Throws:
java.sql.SQLException - If a database access error occurs

setLoginTimeout

public void setLoginTimeout(int value)
                     throws java.sql.SQLException
Sets the maximum time in seconds that this data source will wait while attempting to connect to a database. A value of zero (0) specifies that there is no timeout. When a DataSource object is created, the login timeout is zero initially.

Specified by:
setLoginTimeout in interface javax.sql.DataSource
Parameters:
value - The data source login time limit.
Throws:
java.sql.SQLException - If a database access error occurs

getLogWriter

public java.io.PrintWriter getLogWriter()
                                 throws java.sql.SQLException
Retrieves the log writer for this DataSource object.

Specified by:
getLogWriter in interface javax.sql.DataSource
Returns:
The log writer for this DataSource object.
Throws:
java.sql.SQLException - If a database access error occurs

setLogWriter

public void setLogWriter(java.io.PrintWriter writer)
                  throws java.sql.SQLException
Sets the log writer for this DataSource object.

Specified by:
setLogWriter in interface javax.sql.DataSource
Parameters:
writer - The log writer for this DataSource object.
Throws:
java.sql.SQLException - If a database access error occurs

getConnection

public final java.sql.Connection getConnection()
                                        throws java.sql.SQLException
Attempts to establish a connection with the data source that this DataSource object represents.

Specified by:
getConnection in interface javax.sql.DataSource
Returns:
A connection to the data source.
Throws:
java.sql.SQLException - If a database access error occurs

getConnection

public final java.sql.Connection getConnection(java.lang.String user,
                                               java.lang.String password)
                                        throws java.sql.SQLException
Attempts to establish a connection with the data source that this DataSource object represents.

Specified by:
getConnection in interface javax.sql.DataSource
Parameters:
user - The user name for the connection.
password - The user password for the connection.
Returns:
A connection to the data source.
Throws:
java.sql.SQLException - If a database access error occurs

getPooledConnection

public javax.sql.PooledConnection getPooledConnection()
                                               throws java.sql.SQLException
Attempts to establish a physical database connection that can be used as a pooled connection.

Specified by:
getPooledConnection in interface javax.sql.ConnectionPoolDataSource
Returns:
A PooledConnection object that is a physical connection to the database that this ConnectionPoolDataSource object represents.
Throws:
java.sql.SQLException - If a database access error occurs

getPooledConnection

public javax.sql.PooledConnection getPooledConnection(java.lang.String user,
                                                      java.lang.String password)
                                               throws java.sql.SQLException
Attempts to establish a physical database connection that can be used as a pooled connection.

Specified by:
getPooledConnection in interface javax.sql.ConnectionPoolDataSource
Parameters:
user - The database user name for the connection.
password - The user password for the connection.
Returns:
A PooledConnection object that is a physical connection to the database that this ConnectionPoolDataSource object represents
Throws:
java.sql.SQLException - If a database access error occurs

getXAConnection

public javax.sql.XAConnection getXAConnection()
                                       throws java.sql.SQLException
Attempts to establish a physical database connection. The connection that is returned is one that can be used in a distributed transaction.

Specified by:
getXAConnection in interface javax.sql.XADataSource
Returns:
An XAConnection object, which represents a physical connection to a data source that can be used in a distributed transaction
Throws:
java.sql.SQLException - If a database access error occurs

getXAConnection

public javax.sql.XAConnection getXAConnection(java.lang.String username,
                                              java.lang.String password)
                                       throws java.sql.SQLException
Attempts to establish a physical database connection using the specified user name and password. The connection that is returned is one that can be used in a distributed transaction.

Specified by:
getXAConnection in interface javax.sql.XADataSource
Parameters:
password - The user password for the connection.
Returns:
An XAConnection object, which represents a physical connection to a data source that can be used in a distributed transaction
Throws:
java.sql.SQLException - If a database access error occurs


Stylus Studio features SQL/XML tools for building XML views of relational data.