Skip navigation links

Oracle® TimesTen In-Memory Database JDBC Extensions Java API Reference
Release 11.2.1

E13083-02


com.timesten.jdbc
Class TimesTenDataSource

java.lang.Object
  extended by com.timesten.jdbc.JdbcOdbcObject
      extended by com.timesten.jdbc.TimesTenDriverBase
          extended by com.timesten.jdbc.TimesTenDataSource

All Implemented Interfaces:
java.io.Serializable, java.sql.Wrapper, javax.sql.CommonDataSource, javax.sql.DataSource
Direct Known Subclasses:
ObservableConnectionDS, TimesTenXADataSource

public class TimesTenDataSource
extends com.timesten.jdbc.TimesTenDriverBase
implements javax.sql.DataSource, java.io.Serializable

TimesTenDataSource provides a TimesTen implementation of the javax.sql.DataSource interface, part of the JDBC 2.0 extension. The DataSource interface is the preferred way of obtaining a database connection. The old way of using the Driver interface will be deprecated someday. A DataSource object has properties that can be modified. Setters and Getters must be defined for each modifiable property using a stylized naming convention so that third party application builders can obtain the list of modifiable properties through Java Introspection.

See Also:
Serialized Form

Constructor Summary
TimesTenDataSource()
          Constructs a TimesTenDataSource object.

 

Method Summary
 java.sql.Connection getConnection()
          This method is a required part of the DataSource interface.
 java.sql.Connection getConnection(java.lang.String user, java.lang.String password)
          This method is a required part of the DataSource interface.
 java.lang.String getDescription()
          DataSource property Description.
 int getLoginTimeout()
          This method is a required part of the DataSource interface.
 java.io.PrintWriter getLogWriter()
          This method is a required part of the DataSource interface.
 java.lang.String getOraclePassword()
          DataSource property OraclePassword.
 java.lang.String getPassword()
          DataSource property password.
 java.lang.String getUrl()
          DataSource property url.
 java.lang.String getUser()
          DataSource property user.
 boolean isWrapperFor(java.lang.Class<?> iface)
           
 void setDescription(java.lang.String description)
          DataSource property Description.
 void setLoginTimeout(int timeout)
          This method is a required part of the DataSource interface.
 void setLogWriter(java.io.PrintWriter writer)
          This method is a required part of the DataSource interface.
 void setOraclePassword(java.lang.String oraPwd)
          DataSource property OraclePassword.
 void setPassword(java.lang.String pwd)
          DataSource property password.
 void setUrl(java.lang.String url)
          DataSource property url.
 void setUser(java.lang.String user)
          DataSource property user.
<T> T
unwrap(java.lang.Class<T> iface)
           

 

Methods inherited from class com.timesten.jdbc.TimesTenDriverBase
getProtocol, getSubName, getSubProtocol, getSubProtocolType, isCSConnection, isDirectConnection

 

Methods inherited from class com.timesten.jdbc.JdbcOdbcObject
BytesToChars, CharsToBytes, CharsToBytes, hexPad, hexPairToInt, hexStringToByteArray, isConnectionBroken, toHex

 

Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Constructor Detail

TimesTenDataSource

public TimesTenDataSource()
Constructs a TimesTenDataSource object. Initializes all properties to their default values.

Method Detail

getConnection

public java.sql.Connection getConnection()
                                  throws java.sql.SQLException
This method is a required part of the DataSource interface. 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 java.sql.Connection getConnection(java.lang.String user,
                                         java.lang.String password)
                                  throws java.sql.SQLException
This method is a required part of the DataSource interface. 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 database user on whose behalf the connection is being made
password - the user's password
Returns:
a connection to the data source
Throws:
java.sql.SQLException - if a database access error occurs

getLogWriter

public java.io.PrintWriter getLogWriter()
                                 throws java.sql.SQLException
This method is a required part of the DataSource interface. Retrieves the log writer for this DataSource object. The log writer is a character output stream to which all logging and tracing messages for this data source will be printed. This includes messages printed by the methods of this object, messages printed by methods of other objects manufactured by this object, and so on. Messages printed to a data source specific log writer are not printed to the log writer associated with the java.sql.DriverManager class. When a DataSource object is created, the log writer is initially null; in other words, the default is for logging to be disabled.
Specified by:
getLogWriter in interface javax.sql.CommonDataSource
Returns:
the log writer for this data source or null if logging is disabled
Throws:
java.sql.SQLException - if a database access error occurs

setLogWriter

public void setLogWriter(java.io.PrintWriter writer)
                  throws java.sql.SQLException
This method is a required part of the DataSource interface. Sets the log writer for this DataSource object to the given java.io.PrintWriter object.
Specified by:
setLogWriter in interface javax.sql.CommonDataSource
Parameters:
writer - the new log writer; to disable logging, set to null
Throws:
java.sql.SQLException - if a database access error occurs

setLoginTimeout

public void setLoginTimeout(int timeout)
                     throws java.sql.SQLException
This method is a required part of the DataSource interface. Sets the maximum time in seconds that this data source will wait while attempting to connect to a database. A value of zero specifies that the timeout is the default system timeout if there is one; otherwise it specifies that there is no timeout. When a DataSource object is created the login timeout is initially zero.
Specified by:
setLoginTimeout in interface javax.sql.CommonDataSource
Parameters:
timeout - the data source login time limit
Throws:
java.sql.SQLException - if a database access error occurs

getLoginTimeout

public int getLoginTimeout()
                    throws java.sql.SQLException
This method is a required part of the DataSource interface. Gets the maximum time in seconds that this data source can wait while attempting to connect to a database.
Specified by:
getLoginTimeout in interface javax.sql.CommonDataSource
Returns:
Login time out.
Throws:
java.sql.SQLException - if a database access error occurs

setDescription

public void setDescription(java.lang.String description)
DataSource property Description.

getDescription

public java.lang.String getDescription()
DataSource property Description.
Returns:
DataSource description.

setUser

public void setUser(java.lang.String user)
DataSource property user. This will be used to log into Oracle TimesTen.
Parameters:
user - Oracle TimesTen user name

getUser

public java.lang.String getUser()
DataSource property user. This will be used to log into Oracle TimesTen.
Returns:
DataSource property user.

setPassword

public void setPassword(java.lang.String pwd)
DataSource property password. This will be used to log into Oracle TimesTen.
Parameters:
pwd - DataSource property password.

getPassword

public java.lang.String getPassword()
DataSource property password. This will be used to log into Oracle TimesTen.
Returns:
DataSource property password.

setOraclePassword

public void setOraclePassword(java.lang.String oraPwd)
DataSource property OraclePassword. This will be used to log into Oracle.
Parameters:
oraPwd - DataSource property OraclePassword.

getOraclePassword

public java.lang.String getOraclePassword()
DataSource property OraclePassword. This will be used to log into Oracle.
Returns:
DataSource property OraclePassword.

setUrl

public void setUrl(java.lang.String url)
DataSource property url.
Parameters:
url - DataSource property url.

getUrl

public java.lang.String getUrl()
DataSource property url.
Returns:
DataSource property url.

isWrapperFor

public boolean isWrapperFor(java.lang.Class<?> iface)
                     throws java.sql.SQLException
Specified by:
isWrapperFor in interface java.sql.Wrapper
Throws:
java.sql.SQLException

unwrap

public <T> T unwrap(java.lang.Class<T> iface)
         throws java.sql.SQLException
Specified by:
unwrap in interface java.sql.Wrapper
Throws:
java.sql.SQLException

Skip navigation links

Oracle® TimesTen In-Memory Database JDBC Extensions Java API Reference
Release 11.2.1

E13083-02


Copyright © 1999, 2010, Oracle and/or its affiliates. All rights reserved.