Search in sources :

Example 1 with HQLConnection

use of org.pentaho.platform.plugin.services.connections.hql.HQLConnection in project pentaho-platform by pentaho.

the class HQLBaseComponent method getConnection.

protected IPentahoConnection getConnection(final File hbmCfgFile, final String[] classNames) {
    IPentahoConnection conn = null;
    try {
        // $NON-NLS-1$
        conn = (HQLConnection) PentahoConnectionFactory.getConnection("HQL", getSession(), this);
        HQLConnection hconn = (HQLConnection) conn;
        hconn.setConfigFile(hbmCfgFile);
        hconn.setClassNames(classNames);
        return conn;
    } catch (Exception e) {
        error(Messages.getInstance().getErrorString("HQLBaseComponent.ERROR_0009_COULD_NOT_ESTABLISH_CONNECTION", getActionName()), // $NON-NLS-1$
        e);
    }
    return null;
}
Also used : IPentahoConnection(org.pentaho.commons.connection.IPentahoConnection) HQLConnection(org.pentaho.platform.plugin.services.connections.hql.HQLConnection)

Aggregations

IPentahoConnection (org.pentaho.commons.connection.IPentahoConnection)1 HQLConnection (org.pentaho.platform.plugin.services.connections.hql.HQLConnection)1