Show Table of Contents
2.4. Define a Connection
Extend the
org.teiid.resource.spi.BasicConnection class, and provide an implementation based on your access of the Connection object in your translator. If your connection is stateful, override the isAlive() and cleanup() methods with suitable implementations. These methods are called to check if a connection is stale and needs flushing from the connection pool by the application server.
public class MyConnection extends BasicConnection
{
public void doSomeOperation(Command command)
{
// do some operation with requesting application..
// This is method you use in the Translator, you should know
// what need to be done here for your source..
}
@Override
public boolean isAlive()
{
return true;
}
@Override
public void cleanUp()
{
}
public void close() throws ResourceException
{
}
}

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.