Este contenido no está disponible en el idioma seleccionado.

4.3. Define a Connection Factory


Extend the org.teiid.resourse.spi.BasicConnectionFactory class, and provide an implementation for the getConnection() method. This method will create and return an instance of a connection.
public class MyConnectionFactory extends BasicConnectionFactory 
{
   @Override
   public MyConnection getConnection() throws ResourceException 
   {
      return new MyConnection();
   }  
}
Since the Managed Connection Factory creates a Connection Factory, it has access to all the configuration parameters so that the getConnection() method can pass credentials to the requesting application. Therefore, the Connection Factory can reference the calling user's javax.security.auth.Subject from within the getConnection() method.
Subject subject = ConnectionContext.getSubject();
A Subject can give access to logged-in user's credentials and roles that are defined. This may be null.

Note

You can define a security-domain for this resource adapter that is separate from the default JBoss Data Virtualization security-domain for validating the JDBC user. However, it is the user's responsibility to perform the necessary logins before the application server's thread accesses this resource adapter.
Red Hat logoGithubredditYoutubeTwitter

Aprender

Pruebe, compre y venda

Comunidades

Acerca de la documentación de Red Hat

Ayudamos a los usuarios de Red Hat a innovar y alcanzar sus objetivos con nuestros productos y servicios con contenido en el que pueden confiar. Explore nuestras recientes actualizaciones.

Hacer que el código abierto sea más inclusivo

Red Hat se compromete a reemplazar el lenguaje problemático en nuestro código, documentación y propiedades web. Para más detalles, consulte el Blog de Red Hat.

Acerca de Red Hat

Ofrecemos soluciones reforzadas que facilitan a las empresas trabajar en plataformas y entornos, desde el centro de datos central hasta el perímetro de la red.

Theme

© 2026 Red Hat
Volver arriba