/** * Method is designed to check whether sql queries can be executed via connection with a {@core connName}. * For now we can't allow sql queries for connections, that are based on Pentaho Data Services. * See BISERVER-13225 for more info. * * @param connName * name of connection, to be examined for sql queries support * @throws ConnectionServiceException * if an error occurs while receiving connection with {@code connectionName} * @throws SqlQueriesNotSupportedException * if query is not supported for a connection with a {@code connectionName} */ void checkSqlQueriesSupported( String connName ) throws ConnectionServiceException, SqlQueriesNotSupportedException { IDatabaseConnection conn = connService.getConnectionByName( connName ); IDatabaseType dbType = conn.getDatabaseType(); if ( dbType.getName().equals( DB_TYPE_ID_PENTAHO_DATA_SERVICE ) ) { throw new SqlQueriesNotSupportedException( Messages .getErrorString( "DatasourceServiceImpl.ERROR_0024_SQL_QUERIES_NOT_SUPPORTED_FOR_PENTAHO_DATA_SERVICE" ) ); } }
/** * @param databaseType - A DatabaseType * @return IDatabaseType backed by an DatabaseType * <p/> * Conversion method for creating a Database Type from an Autobean implementation of IDatabaseType */ public static IDatabaseType dbTypeBeanToImpl( IDatabaseType databaseTypeBean ) { DatabaseType databaseTypeImpl = new DatabaseType(); databaseTypeImpl.setDefaultDatabasePort( databaseTypeBean.getDefaultDatabasePort() ); databaseTypeImpl.setExtraOptionsHelpUrl( databaseTypeBean.getExtraOptionsHelpUrl() ); databaseTypeImpl.setName( databaseTypeBean.getName() ); databaseTypeImpl.setShortName( databaseTypeBean.getShortName() ); databaseTypeImpl.setSupportedAccessTypes( listBeanToImpl( databaseTypeBean.getSupportedAccessTypes() ) ); return databaseTypeImpl; }