@Override public String getSelectCountStatement( String tableName ) { if ( databaseDialect != null ) { return databaseDialect.getSelectCountStatement( tableName ); } return super.getSelectCountStatement( tableName ); }
public void run( IProgressMonitor monitor ) throws InvocationTargetException, InterruptedException { db = new Database( Spoon.loggingObject, dbMeta ); try { db.connect(); String sql = dbMeta.getDatabaseInterface().getSelectCountStatement( tableName ); RowMetaAndData row = db.getOneRow( sql ); size = row.getRowMeta().getInteger( row.getData(), 0 ); if ( monitor.isCanceled() ) { throw new InvocationTargetException( new Exception( "This operation was cancelled!" ) ); } } catch ( KettleException e ) { throw new InvocationTargetException( e, "Couldn't get a result because of an error :" + e.toString() ); } finally { db.disconnect(); } } };