Mimer JDBC Engine 2.12

com.mimer.jdbc
Class MimerXADataSource

java.lang.Object
  |
  +--com.mimer.jdbc.MimerDataSource
        |
        +--com.mimer.jdbc.MimerXADataSource
All Implemented Interfaces:
DataSource, Referenceable, Serializable, XADataSource

public class MimerXADataSource
extends MimerDataSource
implements XADataSource, Serializable, Referenceable

MimerXADataSource implements the javax.sql.XADataSource interface and its primary purpose is to provide a connection object for distributed transactions.

The MimerXADataSource object supports Javabeans. This means this class may be configured using generic IDE tools.

Before a connection is attempted by calling MimerConnectionPoolDataSource.getConnection the database name attribute must be set. This specifies database on the host to connect to. Use MimerDataSource.setDatabaseName(java.lang.String) to set this attribute.

See Also:
Serialized Form

Constructor Summary
MimerXADataSource()
           
 
Method Summary
 Connection getConnection()
          The plain .getConnection method from the DataSource is available but always throws an exception.
 Connection getConnection(String user, String password)
          The plain .getConnection method from the DataSource is available but always throws an exception.
 XAConnection getXAConnection()
          Attempts a connection to the host that may be used in distributed transactions.
 XAConnection getXAConnection(String user, String password)
          Attempts the connection, that may be used in distributed transactions, to the host with the specified user and password.
 
Methods inherited from class com.mimer.jdbc.MimerDataSource
getDatabaseName, getDescription, getLoginTimeout, getLogWriter, getPassword, getPortNumber, getReference, getServerName, getUser, setDatabaseName, setDescription, setLoginTimeout, setLogWriter, setPassword, setPortNumber, setServerName, setUser
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.sql.XADataSource
getLoginTimeout, getLogWriter, setLoginTimeout, setLogWriter
 
Methods inherited from interface javax.naming.Referenceable
getReference
 

Constructor Detail

MimerXADataSource

public MimerXADataSource()
Method Detail

getConnection

public Connection getConnection()
                         throws SQLException
The plain .getConnection method from the DataSource is available but always throws an exception.

Specified by:
getConnection in interface DataSource
Overrides:
getConnection in class MimerDataSource
Returns:
The new connection.
SQLException

getConnection

public Connection getConnection(String user,
                                String password)
                         throws SQLException
The plain .getConnection method from the DataSource is available but always throws an exception.

Specified by:
getConnection in interface DataSource
Overrides:
getConnection in class MimerDataSource
Returns:
The new connection.
SQLException

getXAConnection

public XAConnection getXAConnection()
                             throws SQLException
Attempts a connection to the host that may be used in distributed transactions.

Before calling this method, the following attributes should be set.

  • Database name.
  • User name. The user in the database to connect as. Use MimerDataSource.setUser(java.lang.String) to set this attribute.
  • Password. The password of the above user. Use MimerDataSource.setPassword(java.lang.String) to set this attribute.
  • Specified by:
    getXAConnection in interface XADataSource
    Returns:
    The new connection.
    Throws:
    SQLException - if an error occurs. SQLSTATE 08004 is thrown if the connection failed because of a wrong user or password, or if an attempt was made to connect to a Mimer SQL server older than 8.2. 08001 is thrown if the connection failed because the server could not be contacted, perhaps it was down.

    getXAConnection

    public XAConnection getXAConnection(String user,
                                        String password)
                                 throws SQLException
    Attempts the connection, that may be used in distributed transactions, to the host with the specified user and password.

    Before calling this method, the following attributes should be set.

  • Database name.

    Specified by:
    getXAConnection in interface XADataSource
    Returns:
    The new connection.
    Throws:
    SQLException - if an error occurs. SQLSTATE 08004 is thrown if the connection failed because of a wrong user or password, or if an attempt was made to connect to a Mimer SQL server older than 8.2. 08001 is thrown if the connection failed because the server could not be contacted, perhaps it was down.

  • Mimer JDBC Engine 2.12

    Submit a comment or suggestion Version 2.12 of Mimer JDBC Engine
    Copyright Upright Database Technology AB, Box 1713, SE-751 47 UPPSALA, Sweden. All Rights Reserved.