SQLContainer filtering.

Perfectly, I was updated vaadin to version 6.2.2 and now the table is filled according to a container configuration.
Actually, so I receive the container -



JDBCConnectionPool connectionPool = null;

try {
   connectionPool = new SimpleJDBCConnectionPool(
      "oracle.jdbc.OracleDriver",
      "jdbc:oracle:thin:@gissde:1522:EF", "....", "....", 2, 5);
} catch (SQLException e) { 
    e.printStackTrace();
}

FreeformQuery query = new FreeformQuery(
   " SELECT Lookup_Val_id, " + 
   " LOOKUP_VAL_CODE, " + 
   " LOOKUP_VAL_NAME " + 
   " FROM Rz_Lookup_Vals " +
   " WHERE ID_Var=2 AND Lookup_Val_id<>100",
   connectionPool, 
   "Lookup_Val_id"
);		

SQLContainer container = null;
try {
   container = new SQLContainer(query);
} catch (SQLException e) {		
   e.printStackTrace();
}

And so i set it as a source of the data for the table:


   Table table = new Table(null, container);        
   table.setColumnHeaderMode(Table.COLUMN_HEADER_MODE_HIDDEN);        
   table.setContainerDataSource(container);

However the following code to achieve functional a component
instant text field
doesn’t allow:


...
TextField filterField = new TextField("Filter");        
filterField.setTextChangeEventMode(TextChangeEventMode.LAZY);        
filterField.setTextChangeTimeout(200);        
filterField.addListener(new filterFieldListener(container)); 		          
...
class filterFieldListener implements TextChangeListener {
	private SQLContainer container;
	
	filterFieldListener(SQLContainer container) {
		this.container = container;
	}
	
	public void textChange(TextChangeEvent event) {
		// TODO Auto-generated method stub
		container.removeAllContainerFilters();                
		container.addContainerFilter(new Like("LOOKUP_VAL_NAME", event.getText()+"%"));
	}
}


In other words, the filter doesn’t work how it would be desirable by analogy to this example - http://demo.vaadin.com/sampler#TextFieldTextChangeEvent
11768.png

I have rolled away to versions, accordingly:

  • vaadin-6.5.3.jar;
  • vaadin-sqlcontainer-1.0.0.jar

In the listener has added -


...
container.removeAllContainerFilters();                
container.addFilter(new Filter("LOOKUP_VAL_NAME", 
   ComparisonType.STARTS_WITH, event.getText()));		
...

(It agree http://dev.vaadin.com/ wiki/Addons/SQLContainer)

And all the same doesn’t work… What could it be?

Examples from http://dev.vaadin.com/wiki/Addons/SQLContainer in my case also don’t carry out a filtration on a condition. :dry:

Perhaps, depends from RDBMS? I use Oracle-9i.

Now I will try to roll away to Vaadin SLQContainer 0.8 :smiley:

The question remains opened…

Hi,

I already mostly answered this question in your other thread
here
.

In short, you should either use the TableQuery class or implement your own FreeformQueryDelegate which should handle generating the filtering queries for your custom query. Please see the SQLContainer manual and the demo application sources for more information on how to do the latter. If you have difficulties implementing the FreeformQueryDelegate interface, please post a new question about that.

The example is in the class com.vaadin.addon.sqlcontainer.demo.DemoFreeformQueryDelegate found in the SQLContainer source code.


Tepi

I welcome you once again Teppo Kurki!

So, my problem consists in the following - there is a fine component. instant text field, using IndexedContainer which can be found
here
.

Here a code of a demonstration example -


...
final IndexedContainer nameContainer = ExampleUtil.getNameContainer();
TextField filterField = new TextField("Filter");        
filterField.setTextChangeEventMode(TextChangeEventMode.LAZY);        
filterField.setTextChangeTimeout(200);        
filterField.addListener(new TextChangeListener() {               
   public void textChange(TextChangeEvent event)  {                      
      nameContainer.removeAllContainerFilters();                      
      nameContainer.addContainerFilter(ExampleUtil.PERSON_PROPERTY_NAME, 
                event.getText(),true,false);               
   }        
});                  

Table table = new Table(null, nameContainer);        
table.setColumnHeaderMode(Table.COLUMN_HEADER_MODE_HIDDEN);
table.setContainerDataSource(nameContainer);
...

API add - it SQLContainer gives the classes, allowing to set SQL - scenarios in the free form, i.e. just that is necessary in my case. For vaadin-6.6 and SQLContainer-1.1 it is had:


...
JDBCConnectionPool connectionPool = null;
try {   
   connectionPool = new SimpleJDBCConnectionPool("oracle.jdbc.OracleDriver",      
          "jdbc:oracle:thin:@gissde:1522:EF", "....", "....", 2, 5);
}
catch (SQLException e) {     
   e.printStackTrace();
}

FreeformQuery query = new FreeformQuery(" ...some query..", connectionPool, "...some field....");        
SQLContainer container = null;

try {   
   container = new SQLContainer(query);
} 
catch (SQLException e) {           
   e.printStackTrace();
}

....

Table table = new Table(null, container);           
table.setColumnHeaderMode(Table.COLUMN_HEADER_MODE_HIDDEN);           
table.setContainerDataSource(container);

....

TextField filterField = new TextField("Filter");        
filterField.setTextChangeEventMode(TextChangeEventMode.LAZY);        
filterField.setTextChangeTimeout(200);        
filterField.addListener(new filterFieldListener(container));                   

...

class filterFieldListener implements TextChangeListener {    
   private SQLContainer container;        
   filterFieldListener(SQLContainer container) {        
       this.container = container;    
   }        

   public void textChange(TextChangeEvent event)  {        
      // TODO Auto-generated method stub        
      container.removeAllContainerFilters();                        
      container.addContainerFilter(new Like("..some field....", event.getText()+"%"));    
   }
}

...

All is fine, however filter Like (“. some field…”, event.getText () + “%”) doesn’t fulfill.

If a little to roll away artifacts - result same.

I.e. in the listener we have possibility to set a condition of a filtration of records of the table.

I have looked DemoFreeformQueryDelegate and question in the following - how to realize something similar for a case if inquiries come from external system and it is in advance known only, what there will be a sample? I.e. the inquiry can be anyone. Whether There is a dependence of realization delegate from this or that table?



...

select org_id, decode(shortname, null, 'other', shortname) shortname from etran.org_passport@lnk_arc 
where sysdate>=recdatebegin and sysdate<=recdateend

SELECT Lookup_Val_id,LOOKUP_VAL_CODE,LOOKUP_VAL_NAME FROM Rz_Lookup_Vals
WHERE ID_Var=58

SELECT Lookup_Val_id,LOOKUP_VAL_CODE,LOOKUP_VAL_NAME FROM Rz_Lookup_Vals
WHERE ID_Var=15

SELECT Lookup_Val_id,LOOKUP_VAL_CODE,LOOKUP_VAL_NAME FROM Rz_Lookup_Vals
WHERE ID_Var=20

SELECT Lookup_Val_id,LOOKUP_VAL_CODE,LOOKUP_VAL_NAME FROM Rz_Lookup_Vals
WHERE ID_Var=20

SELECT id,Kod,NAME 
FROM Nsi_Stations 

...

For each case the separate delegate is required?

Basically, each case requires its own delegate in case you wish to support all the features: filtering, sorting, lazy loading and especially writing to the appropriate table(s) in the correct way. There is just no way the SQLContainer can guess how these queries should be built, since your initial query could be infinitely complex.

In case you need only filtering and your queries are at least somewhat similar, you could get away with implementing just one (or a few) delegates and supply the information you require about the query in the delegate’s constructor. Your delegate would then generate the queries as needed. I have not tried this myself, and there may be some unforeseen caveats in this approach.

If you have an enormous amount of external (or previously unknown) queries, then this approach will obviously not work.

Have you considered to use the TableQuery delegate? For example, one of your queries:

“SELECT Lookup_Val_id,LOOKUP_VAL_CODE,LOOKUP_VAL_NAME FROM Rz_Lookup_Vals WHERE ID_Var=15”

Could be realized as a TableQuery with the table name " Rz_Lookup_Vals", and then just adding an ‘Equal’ filter for the ID_Var. After this you could use lazy loading, filtering and sorting automatically. Only drawback would be that if the table has very many columns, SQLContainer will select them all, instead of the three specified in your query.

So in short - unfortunately I have no exact solution for you.


Tepi

Has tried to apply TableQuery query delegate, approximately so -


...
SQLContainer container = null;
		 
TableQuery tq = new TableQuery("Rz_Lookup_Vals", connPool);
tq.setVersionColumn("OPTLOCK");
		 
try {
      container = new SQLContainer(tq);
} catch (SQLException e)  {			
    e.printStackTrace();
}
		
Like like = new Like("LOOKUP_VAL_NAME", "A%");
container.addContainerFilter(like);
		 
Table table = new Table(null, container);           
table.setColumnHeaderMode(Table.COLUMN_HEADER_MODE_HIDDEN);           
table.setContainerDataSource(container);
		 
mainWindow.addComponent(table);
...

However there was emission NullPointerException, has looked under a debugger, here -


container = new SQLContainer(tq);

detailMessage e:


ORA-00933: incorrect end of the SQL-offer

You don’t know, what it could mean?

So, we debug further:

In SQLContainer.class:



...
    public SQLContainer(QueryDelegate delegate) throws SQLException {
        if (delegate == null) {
            throw new IllegalArgumentException(
                    "QueryDelegate must not be null.");
        }
        this.delegate = delegate;
[b]
        getPropertyIds();
[/b]
        cachedItems.setCacheLimit(CACHE_RATIO * getPageLength());
    }

....

 private void getPropertyIds() throws SQLException {
        propertyIds.clear();
        propertyTypes.clear();
        delegate.setFilters(null);
        delegate.setOrderBy(null);
        ResultSet rs = null;
        ResultSetMetaData rsmd = null;
        try {
            delegate.beginTransaction();
    [b]
        rs = delegate.getResults(0, 1);
[/b]
....

In TableQuery.class:


  public ResultSet getResults(int offset, int pagelength) throws SQLException {
        StatementHelper sh;
        /*
         * If no ordering is explicitly set, results will be ordered by the
         * first primary key column.
         */
        if (orderBys == null || orderBys.isEmpty()) {
            List<OrderBy> ob = new ArrayList<OrderBy>();
            ob.add(new OrderBy(primaryKeyColumns.get(0), true));
            sh = sqlGenerator.generateSelectQuery(tableName, filters, ob,
                    offset, pagelength, null);
        } else {
        [b]
    sh = sqlGenerator.generateSelectQuery(tableName, filters, orderBys,
                    offset, pagelength, null);
[/b]        }
        return executeQuery(sh);
    }


As a result the inquiry assumes such air -


SELECT * FROM RZ_LOOKUP_VALS ORDER BY “ID_VAR” ASC LIMIT 1 OFFSET 0

How to get rid from
ASC LIMIT 1 OFFSET 0
?

I see you’re using Oracle. Since it uses a slightly different sql dialect, you must construct your TableQuery like this:

TableQuery tq = new TableQuery("Rz_Lookup_Vals", connPool, new OracleGenerator());

MS SQL also requires a different query generator; MSSQLGenerator.


Tepi

:smiley:
11774.png

The full decision can look, for example, so -


public class TestsqlconApplication extends Application {
	private Table table;
	private Window mainWindow;
	private SQLContainer container; 
	private SimpleJDBCConnectionPool connPool;
	
	@Override
	public void init() {
		mainWindow = new Window("Testsqlcon Application");
		setMainWindow(mainWindow);
				
		try {
			connPool = new SimpleJDBCConnectionPool("oracle.jdbc.OracleDriver",
					"jdbc:oracle:thin:@gissde:1522:EF", "...", "...", 2, 5);
			
		} catch (SQLException e1) {
			e1.printStackTrace();
		}
		 
		TableQuery tq = new TableQuery("SOME_TABLE_NAME", connPool, new OracleGenerator());				 
		try {
			container = new SQLContainer(tq);
		} catch (SQLException e) {			
			e.printStackTrace();
		}
		
		Like like = new Like("SOME_FIELD_NAME", "%");
		container.addContainerFilter(like);

		TextField filterField = new TextField("Filter");        
		filterField.setTextChangeEventMode(TextChangeEventMode.LAZY);        
		filterField.setTextChangeTimeout(200);        
		filterField.addListener(new filterFieldListener(container)); 		
		
		Table table = new Table(null, container);           
		table.setColumnHeaderMode(Table.COLUMN_HEADER_MODE_HIDDEN);           
		table.setContainerDataSource(container);
		
		mainWindow.addComponent(filterField);
		mainWindow.addComponent(table);
	}

	class filterFieldListener implements TextChangeListener {
		private SQLContainer container;		
		
		filterFieldListener(SQLContainer container) {
			this.container = container;
		}
		
		public void textChange(TextChangeEvent event) {
			Like like = new Like("SOME_FIELD_NAME", event.getText()+"%");
			container.removeAllContainerFilters();
			container.addContainerFilter(like);						
		}
	}
}

Nice work! Glad that you finally got it working!

Do come back to the forums if you run into any more difficulties :)

I welcome!

There was such problem - at use SQLContainer some names of tables aren’t distinguished, though they are present at the database - look at it:


table name: etran.org_passport@lnk_arc

MyClass -


if(tableName != null) tableName = tableName.trim();
[b]
TableQuery tq = new TableQuery(tableName, connPool, new OracleGenerator());
[/b]
try {
   container = new SQLContainer(tq);
} catch (SQLException e) {			
   e.printStackTrace();
}

TableQuery.class -


 public TableQuery(String tableName, JDBCConnectionPool connectionPool,
            SQLGenerator sqlGenerator) {
        if (tableName == null || tableName.trim().length() < 1
                || connectionPool == null || sqlGenerator == null) {
            throw new IllegalArgumentException(
                    "All parameters must be non-null and a table name must be given.");
        }
        this.tableName = tableName;
        this.sqlGenerator = sqlGenerator;
        this.connectionPool = connectionPool;
[b]
        fetchMetaData();
[/b]
    }

further -


private void fetchMetaData() {
        Connection c = null;
        try {
            c = connectionPool.reserveConnection();
            DatabaseMetaData dbmd = c.getMetaData();
            if (dbmd != null) {
                tableName = Util.escapeSQL(tableName);
                ResultSet tables = dbmd.getTables(null, null, tableName, null);
                if (!tables.next()) {
                    tables = dbmd.getTables(null, null,
                            tableName.toUpperCase(), null);
[b]
                    if (!tables.next()) {
[/b]
                        throw new IllegalArgumentException(
[b]
                                "Table with the name \""
                                        + tableName
                                        + "\" was not found. Check your database contents.");
[/b]                    } else {


Table with the name “etran.org_passport@lnk_arc” was not found. Check your database contents

now I open PL/ SQL Developer also I do inquiry:


select * from etran.org_passport@lnk_arc t

Ta- dam!

On an exit some sample. With what can be connected that in a method
fetchMetaData()
The table isn’t in data base?

I would guess that your table name “etran.org_passport@lnk_arc” is causing some identifier resolving in the database. Running a direct query against the database will do this resolving, but the metadata will not. Is “etran.org_passport@lnk_arc” the actual table name or is e.g. the schema/db name some part of it?

it could be useful to put a debug breakpoint in the TableQuery class to see what is actually returned in the tables ResultSet.


Tepi

I welcome, Tepi! Is glad to see you again! :smiley:

Actually,
etran
- this name of the scheme, I tried without it, i.e. have registered
org_passport@lnk_arc
,
but the result has not changed. I assume that symbol
@
presence in a name affects.

Actually, here the debugging report -

TableQuery class:


...
    /**
     * Fetches name(s) of primary key column(s) from DB metadata.
     * 
     * Also tries to get the escape string to be used in search strings.
     */
    private void fetchMetaData() {
        Connection c = null;
        try {
            c = connectionPool.reserveConnection();
            DatabaseMetaData dbmd = c.getMetaData();
            if (dbmd != null) {
                tableName = Util.escapeSQL(tableName);
                ResultSet tables = dbmd.getTables(null, null, tableName, null);
                if (!tables.next()) {
                    tables = dbmd.getTables(null, null,
                            tableName.toUpperCase(), null);
                    if (!tables.next()) {
                        throw new IllegalArgumentException(
                                "Table with the name \""
                                        + tableName
                                        + "\" was not found. Check your database contents.");
...

...
 DatabaseMetaData dbmd = c.getMetaData();
...

dbmd == oracle.jdbc.driver.OracleDatabaseMetaData@f66f2f


...
 tableName = Util.escapeSQL(tableName);
    [b]
 ResultSet tables = dbmd.getTables(null, null, tableName, null);
[/b]                
    if (!tables.next()) {
...

tables →


tables	OracleResultSetImpl  (id=327)	
	autoRefetch	true	
	close_statement_on_close	true	
	closed	false	
	connection	T4CConnection  (id=202)	
	explicitly_closed	false	
	m_emptyRset	false	
	sqlWarning	null	
	statement	T4CPreparedStatement  (id=337)	
		accessorByteOffset	0	
		accessorCharOffset	0	
		accessors	Accessor[5]
  (id=347)	
		accessorShortOffset	0	
		autoKeyInfo	null	
		autoRefetch	true	
		autoRollback	2	
		batch	1	
		bindBufferCapacity	1	
		bindByteOffset	0	
		bindBytes	null	
		bindByteSubRange	0	
		bindCharOffset	0	
		bindChars	 (id=352)	
		bindCharSubRange	0	
		binders	Binder[1]
[]  (id=353)	
		bindIndicatorOffset	0	
		bindIndicators	 (id=357)	
		bindIndicatorSubRange	0	
		c_state	0	
		cachedDefineByteSize	0	
		cachedDefineCharSize	0	
		cachedDefineIndicatorSize	0	
		cacheState	1	
		charMaxCharsSql	0	
		charMaxNCharsSql	0	
		checkBindTypes	true	
		children	null	
		clearParameters	false	
		closed	false	
		columnsDefinedByUser	false	
		columnSetNull	false	
		connection	T4CConnection  (id=202)	
		convertNcharLiterals	false	
		creationState	0	
		currentBatchBindAccessors	null	
		currentBatchCharLens	 (id=358)	
		currentBatchFormOfUse	 (id=359)	
		currentBatchNeedToPrepareBinds	false	
		currentRank	0	
		currentResultSet	OracleResultSetImpl  (id=327)	
		currentRow	-1	
		currentRowBindAccessors	null	
		currentRowBinders	Binder[2]
  (id=360)	
		currentRowCharLens	 (id=361)	
		currentRowFormOfUse	 (id=362)	
		currentRowNeedToPrepareBinds	false	
		cursorId	1	
		defaultFetchDirection	1000	
		defaultRowPrefetch	10	
		defaultTZ	null	
		defineBytes	 (id=363)	
		defineByteSubRange	0	
		defineChars	 (id=364)	
		defineCharSubRange	80830	
		definedColumnFormOfUse	null	
		definedColumnSize	null	
		definedColumnType	null	
		defineIndicators	 (id=365)	
		defineIndicatorSubRange	50	
		defineLengthSubRange	0	
		definesBatchSize	10	
		described	true	
		describedWithNames	true	
		digits	 (id=366)	
		executionType	1	
		firstRowInBatch	0	
		fixedString	false	
		gotLastBatch	true	
		hasIbtBind	false	
		ibtBindByteOffset	0	
		ibtBindBytes	null	
		ibtBindCharOffset	0	
		ibtBindChars	null	
		ibtBindIndicatorOffset	0	
		ibtBindIndicators	null	
		ibtBindIndicatorSize	0	
		indicatorsOffset	23	
		isAutoGeneratedKey	false	
		isExecuting	false	
		isOpen	true	
		isServerCharSetFixedWidth	false	
		isServerNCharSetFixedWidth	true	
		lastBinders	Binder[2]
  (id=367)	
		lastBoundByteLens	 (id=368)	
		lastBoundByteOffset	0	
		lastBoundByteOffsets	 (id=369)	
		lastBoundBytes	null	
		lastBoundCharLens	 (id=370)	
		lastBoundCharOffset	0	
		lastBoundCharOffsets	 (id=371)	
		lastBoundChars	 (id=352)	
		lastBoundInds	 (id=372)	
		lastBoundLens	 (id=373)	
		lastBoundNeeded	false	
		lastBoundTypeBytes	 (id=374)	
		lastBoundTypeOtypes	OracleTypeADT[2]
  (id=375)	
		lastIndex	0	
		m_batchItems	Vector<E>  (id=377)	
		m_batchStyle	0	
		maxCharSize	1	
		maxFieldSize	0	
		maxNCharSize	2	
		maxRawBytesPlsql	32512	
		maxRawBytesSql	2000	
		maxRows	0	
		maxStreamCharsSql	2147483647	
		maxStreamNCharsSql	1000	
		maxVcsBytesPlsql	32512	
		maxVcsCharsPlsql	32512	
		maxVcsCharsSql	32766	
		maxVcsNCharsPlsql	16256	
		minVcsBindSize	0	
		needToAddIdentifier	false	
		needToParse	false	
		needToPrepareDefineBuffer	false	
		needToSendOalToFetch	false	
		next	null	
		nextChild	null	
		nextStream	null	
		noMoreUpdateCounts	false	
		numberOfBindPositions	2	
		numberOfBindRowsAllocated	1	
		numberOfBoundRows	1	
		numberOfDefinePositions	5	
		numReturnParams	0	
		oacdefSent	T4CTTIoac[2]
  (id=379)	
		oldTempBlobsToFree	null	
		oldTempClobsToFree	null	
		outBindAccessors	null	
		parameterBigDecimal	null	
		parameterDate	null	
		parameterDatum	null	
		parameterDouble	null	
		parameterFloat	null	
		parameterInt	null	
		parameterLong	null	
		parameterOtype	null	
		parameterPlsqlIbt	null	
		parameterStream	null	
		parameterString	String[1]
[]  (id=383)	
		parameterTime	null	
		parameterTimestamp	null	
		prematureBatchCount	0	
		preparedAllBinds	true	
		preparedCharBinds	true	
		prev	null	
		processEscapes	true	
		pushedBatches	null	
		pushedBatchesTail	null	
		queryTimeout	0	
		realRsetType	1	
		returnParamAccessors	null	
		returnParamBytes	null	
		returnParamChars	null	
		returnParamIndicators	null	
		returnParamMeta	null	
		returnParamRowBytes	0	
		returnParamRowChars	0	
		returnParamsFetched	false	
		returnResultSet	null	
		rowPrefetch	10	
		rowPrefetchChanged	false	
		rowsDmlReturned	0	
		rowsProcessed	0	
		rsetCache	null	
		saved_rowPrefetch	-1	
		scrollRset	null	
		scrollRsetTypeSolved	false	
		serverCursor	false	
		SetBigStringTryClob	0	
		sizeTmpByteArray	12000	
		sqlKind	0	
		sqlObject	OracleSql  (id=390)	
		sqlStringChanged	true	
		sqlWarning	null	
		statementType	1	
		streamList	null	
		t4Connection	T4CConnection  (id=202)	
		tempBlobsToFree	null	
		tempClobsToFree	null	
		theBfileBinder	BfileBinder  (id=392)	
		theBfileNullBinder	BfileNullBinder  (id=394)	
		theBigDecimalBinder	BigDecimalBinder  (id=396)	
		theBINARY_DOUBLEBinder	BINARY_DOUBLEBinder  (id=398)	
		theBINARY_DOUBLENullBinder	BINARY_DOUBLENullBinder  (id=400)	
		theBINARY_FLOATBinder	BINARY_FLOATBinder  (id=402)	
		theBINARY_FLOATNullBinder	BINARY_FLOATNullBinder  (id=404)	
		theBinaryDoubleBinder	BinaryDoubleBinder  (id=406)	
		theBinaryDoubleNullBinder	BinaryDoubleNullBinder  (id=408)	
		theBinaryFloatBinder	BinaryFloatBinder  (id=410)	
		theBinaryFloatNullBinder	BinaryFloatNullBinder  (id=412)	
		theBlobBinder	BlobBinder  (id=414)	
		theBlobNullBinder	BlobNullBinder  (id=416)	
		theBooleanBinder	BooleanBinder  (id=418)	
		theByteBinder	ByteBinder  (id=420)	
		theClobBinder	ClobBinder  (id=422)	
		theClobNullBinder	ClobNullBinder  (id=424)	
		theDateBinder	DateBinder  (id=426)	
		theDateNullBinder	DateNullBinder  (id=428)	
		theDoubleBinder	null	
		theFixedCHARBinder	FixedCHARBinder  (id=430)	
		theFixedCHARNullBinder	FixedCHARNullBinder  (id=432)	
		theFloatBinder	null	
		theIntBinder	IntBinder  (id=434)	
		theIntervalDSBinder	IntervalDSBinder  (id=436)	
		theIntervalDSNullBinder	IntervalDSNullBinder  (id=438)	
		theIntervalYMBinder	IntervalYMBinder  (id=440)	
		theIntervalYMNullBinder	IntervalYMNullBinder  (id=442)	
		theLongBinder	LongBinder  (id=444)	
		theLongRawStreamBinder	LongRawStreamBinder  (id=446)	
		theLongStreamBinder	LongStreamBinder  (id=448)	
		theNamedTypeBinder	NamedTypeBinder  (id=450)	
		theNamedTypeNullBinder	NamedTypeNullBinder  (id=452)	
		theOracleDateBinder	OracleDateBinder  (id=454)	
		theOracleNumberBinder	OracleNumberBinder  (id=456)	
		theOracleTimestampBinder	OracleTimestampBinder  (id=458)	
		theOutBinder	OutBinder  (id=460)	
		thePlsqlIbtBinder	PlsqlIbtBinder  (id=462)	
		thePlsqlNullBinder	PlsqlIbtNullBinder  (id=464)	
		thePlsqlRawBinder	PlsqlRawBinder  (id=466)	
		theRawBinder	RawBinder  (id=468)	
		theRawNullBinder	RawNullBinder  (id=470)	
		theRefTypeBinder	RefTypeBinder  (id=472)	
		theRefTypeNullBinder	RefTypeNullBinder  (id=474)	
		theReturnParamBinder	ReturnParamBinder  (id=476)	
		theRowidBinder	T4CRowidBinder  (id=478)	
		theRowidNullBinder	T4CRowidNullBinder  (id=480)	
		theSetCHARBinder	SetCHARBinder  (id=482)	
		theSetCHARNullBinder	SetCHARNullBinder  (id=484)	
		theShortBinder	ShortBinder  (id=486)	
		theStringBinder	StringBinder  (id=488)	
		theTimeBinder	TimeBinder  (id=490)	
		theTimestampBinder	TimestampBinder  (id=492)	
		theTimestampNullBinder	TimestampNullBinder  (id=494)	
		theTSLTZBinder	TSLTZBinder  (id=496)	
		theTSLTZNullBinder	TSLTZNullBinder  (id=498)	
		theTSTZBinder	TSTZBinder  (id=500)	
		theTSTZNullBinder	TSTZNullBinder  (id=502)	
		theVarcharNullBinder	VarcharNullBinder  (id=504)	
		theVarnumNullBinder	VarnumNullBinder  (id=506)	
		tmpBindsByteArray	 (id=508)	
		tmpByteArray	 (id=509)	
		totalBindByteLength	0	
		totalBindCharLength	29	
		totalBindIndicatorLength	27	
		totalRowsVisited	0	
		userRsetType	1	
		validRows	0	
		valueLengthsOffset	25	

tables.next() == false, therefore further:


...
                   tables = dbmd.getTables(null, null,
                            tableName.toUpperCase(), null);
                    if (!tables.next()) {...

Now tables consist:



tables	OracleResultSetImpl  (id=511)	
	autoRefetch	true	
	close_statement_on_close	true	
	closed	false	
	connection	T4CConnection  (id=202)	
	explicitly_closed	false	
	m_emptyRset	false	
	sqlWarning	null	
	statement	T4CPreparedStatement  (id=512)	
		accessorByteOffset	0	
		accessorCharOffset	0	
		accessors	Accessor[5]
  (id=515)	
		accessorShortOffset	0	
		autoKeyInfo	null	
		autoRefetch	true	
		autoRollback	2	
		batch	1	
		bindBufferCapacity	1	
		bindByteOffset	0	
		bindBytes	null	
		bindByteSubRange	0	
		bindCharOffset	0	
		bindChars	 (id=518)	
		bindCharSubRange	0	
		binders	Binder[1]
[]  (id=520)	
		bindIndicatorOffset	0	
		bindIndicators	 (id=522)	
		bindIndicatorSubRange	0	
		c_state	0	
		cachedDefineByteSize	0	
		cachedDefineCharSize	0	
		cachedDefineIndicatorSize	0	
		cacheState	1	
		charMaxCharsSql	0	
		charMaxNCharsSql	0	
		checkBindTypes	true	
		children	null	
		clearParameters	false	
		closed	false	
		columnsDefinedByUser	false	
		columnSetNull	false	
		connection	T4CConnection  (id=202)	
		convertNcharLiterals	false	
		creationState	0	
		currentBatchBindAccessors	null	
		currentBatchCharLens	 (id=528)	
		currentBatchFormOfUse	 (id=529)	
		currentBatchNeedToPrepareBinds	false	
		currentRank	0	
		currentResultSet	OracleResultSetImpl  (id=511)	
		currentRow	-1	
		currentRowBindAccessors	null	
		currentRowBinders	Binder[2]
  (id=531)	
		currentRowCharLens	 (id=533)	
		currentRowFormOfUse	 (id=534)	
		currentRowNeedToPrepareBinds	false	
		cursorId	2	
		defaultFetchDirection	1000	
		defaultRowPrefetch	10	
		defaultTZ	null	
		defineBytes	 (id=537)	
		defineByteSubRange	0	
		defineChars	 (id=538)	
		defineCharSubRange	80830	
		definedColumnFormOfUse	null	
		definedColumnSize	null	
		definedColumnType	null	
		defineIndicators	 (id=540)	
		defineIndicatorSubRange	50	
		defineLengthSubRange	0	
		definesBatchSize	10	
		described	true	
		describedWithNames	true	
		digits	 (id=542)	
		executionType	1	
		firstRowInBatch	0	
		fixedString	false	
		gotLastBatch	true	
		hasIbtBind	false	
		ibtBindByteOffset	0	
		ibtBindBytes	null	
		ibtBindCharOffset	0	
		ibtBindChars	null	
		ibtBindIndicatorOffset	0	
		ibtBindIndicators	null	
		ibtBindIndicatorSize	0	
		indicatorsOffset	23	
		isAutoGeneratedKey	false	
		isExecuting	false	
		isOpen	true	
		isServerCharSetFixedWidth	false	
		isServerNCharSetFixedWidth	true	
		lastBinders	Binder[2]
  (id=545)	
		lastBoundByteLens	 (id=546)	
		lastBoundByteOffset	0	
		lastBoundByteOffsets	 (id=548)	
		lastBoundBytes	null	
		lastBoundCharLens	 (id=549)	
		lastBoundCharOffset	0	
		lastBoundCharOffsets	 (id=551)	
		lastBoundChars	 (id=518)	
		lastBoundInds	 (id=553)	
		lastBoundLens	 (id=554)	
		lastBoundNeeded	false	
		lastBoundTypeBytes	 (id=555)	
		lastBoundTypeOtypes	OracleTypeADT[2]
  (id=556)	
		lastIndex	0	
		m_batchItems	Vector<E>  (id=557)	
		m_batchStyle	0	
		maxCharSize	1	
		maxFieldSize	0	
		maxNCharSize	2	
		maxRawBytesPlsql	32512	
		maxRawBytesSql	2000	
		maxRows	0	
		maxStreamCharsSql	2147483647	
		maxStreamNCharsSql	1000	
		maxVcsBytesPlsql	32512	
		maxVcsCharsPlsql	32512	
		maxVcsCharsSql	32766	
		maxVcsNCharsPlsql	16256	
		minVcsBindSize	0	
		needToAddIdentifier	false	
		needToParse	false	
		needToPrepareDefineBuffer	false	
		needToSendOalToFetch	false	
		next	T4CPreparedStatement  (id=337)	
		nextChild	null	
		nextStream	null	
		noMoreUpdateCounts	false	
		numberOfBindPositions	2	
		numberOfBindRowsAllocated	1	
		numberOfBoundRows	1	
		numberOfDefinePositions	5	
		numReturnParams	0	
		oacdefSent	T4CTTIoac[2]
  (id=560)	
		oldTempBlobsToFree	null	
		oldTempClobsToFree	null	
		outBindAccessors	null	
		parameterBigDecimal	null	
		parameterDate	null	
		parameterDatum	null	
		parameterDouble	null	
		parameterFloat	null	
		parameterInt	null	
		parameterLong	null	
		parameterOtype	null	
		parameterPlsqlIbt	null	
		parameterStream	null	
		parameterString	String[1]
[]  (id=563)	
		parameterTime	null	
		parameterTimestamp	null	
		prematureBatchCount	0	
		preparedAllBinds	true	
		preparedCharBinds	true	
		prev	null	
		processEscapes	true	
		pushedBatches	null	
		pushedBatchesTail	null	
		queryTimeout	0	
		realRsetType	1	
		returnParamAccessors	null	
		returnParamBytes	null	
		returnParamChars	null	
		returnParamIndicators	null	
		returnParamMeta	null	
		returnParamRowBytes	0	
		returnParamRowChars	0	
		returnParamsFetched	false	
		returnResultSet	null	
		rowPrefetch	10	
		rowPrefetchChanged	false	
		rowsDmlReturned	0	
		rowsProcessed	0	
		rsetCache	null	
		saved_rowPrefetch	-1	
		scrollRset	null	
		scrollRsetTypeSolved	false	
		serverCursor	false	
		SetBigStringTryClob	0	
		sizeTmpByteArray	12000	
		sqlKind	0	
		sqlObject	OracleSql  (id=567)	
		sqlStringChanged	true	
		sqlWarning	null	
		statementType	1	
		streamList	null	
		t4Connection	T4CConnection  (id=202)	
		tempBlobsToFree	null	
		tempClobsToFree	null	
		theBfileBinder	BfileBinder  (id=392)	
		theBfileNullBinder	BfileNullBinder  (id=394)	
		theBigDecimalBinder	BigDecimalBinder  (id=396)	
		theBINARY_DOUBLEBinder	BINARY_DOUBLEBinder  (id=398)	
		theBINARY_DOUBLENullBinder	BINARY_DOUBLENullBinder  (id=400)	
		theBINARY_FLOATBinder	BINARY_FLOATBinder  (id=402)	
		theBINARY_FLOATNullBinder	BINARY_FLOATNullBinder  (id=404)	
		theBinaryDoubleBinder	BinaryDoubleBinder  (id=406)	
		theBinaryDoubleNullBinder	BinaryDoubleNullBinder  (id=408)	
		theBinaryFloatBinder	BinaryFloatBinder  (id=410)	
		theBinaryFloatNullBinder	BinaryFloatNullBinder  (id=412)	
		theBlobBinder	BlobBinder  (id=414)	
		theBlobNullBinder	BlobNullBinder  (id=416)	
		theBooleanBinder	BooleanBinder  (id=418)	
		theByteBinder	ByteBinder  (id=420)	
		theClobBinder	ClobBinder  (id=422)	
		theClobNullBinder	ClobNullBinder  (id=424)	
		theDateBinder	DateBinder  (id=426)	
		theDateNullBinder	DateNullBinder  (id=428)	
		theDoubleBinder	null	
		theFixedCHARBinder	FixedCHARBinder  (id=430)	
		theFixedCHARNullBinder	FixedCHARNullBinder  (id=432)	
		theFloatBinder	null	
		theIntBinder	IntBinder  (id=434)	
		theIntervalDSBinder	IntervalDSBinder  (id=436)	
		theIntervalDSNullBinder	IntervalDSNullBinder  (id=438)	
		theIntervalYMBinder	IntervalYMBinder  (id=440)	
		theIntervalYMNullBinder	IntervalYMNullBinder  (id=442)	
		theLongBinder	LongBinder  (id=444)	
		theLongRawStreamBinder	LongRawStreamBinder  (id=446)	
		theLongStreamBinder	LongStreamBinder  (id=448)	
		theNamedTypeBinder	NamedTypeBinder  (id=450)	
		theNamedTypeNullBinder	NamedTypeNullBinder  (id=452)	
		theOracleDateBinder	OracleDateBinder  (id=454)	
		theOracleNumberBinder	OracleNumberBinder  (id=456)	
		theOracleTimestampBinder	OracleTimestampBinder  (id=458)	
		theOutBinder	OutBinder  (id=460)	
		thePlsqlIbtBinder	PlsqlIbtBinder  (id=462)	
		thePlsqlNullBinder	PlsqlIbtNullBinder  (id=464)	
		thePlsqlRawBinder	PlsqlRawBinder  (id=466)	
		theRawBinder	RawBinder  (id=468)	
		theRawNullBinder	RawNullBinder  (id=470)	
		theRefTypeBinder	RefTypeBinder  (id=472)	
		theRefTypeNullBinder	RefTypeNullBinder  (id=474)	
		theReturnParamBinder	ReturnParamBinder  (id=476)	
		theRowidBinder	T4CRowidBinder  (id=478)	
		theRowidNullBinder	T4CRowidNullBinder  (id=480)	
		theSetCHARBinder	SetCHARBinder  (id=482)	
		theSetCHARNullBinder	SetCHARNullBinder  (id=484)	
		theShortBinder	ShortBinder  (id=486)	
		theStringBinder	StringBinder  (id=488)	
		theTimeBinder	TimeBinder  (id=490)	
		theTimestampBinder	TimestampBinder  (id=492)	
		theTimestampNullBinder	TimestampNullBinder  (id=494)	
		theTSLTZBinder	TSLTZBinder  (id=496)	
		theTSLTZNullBinder	TSLTZNullBinder  (id=498)	
		theTSTZBinder	TSTZBinder  (id=500)	
		theTSTZNullBinder	TSTZNullBinder  (id=502)	
		theVarcharNullBinder	VarcharNullBinder  (id=504)	
		theVarnumNullBinder	VarnumNullBinder  (id=506)	
		tmpBindsByteArray	 (id=579)	
		tmpByteArray	 (id=580)	
		totalBindByteLength	0	
		totalBindCharLength	29	
		totalBindIndicatorLength	27	
		totalRowsVisited	0	
		userRsetType	1	
		validRows	0	
		valueLengthsOffset	25

But now i get to a branch:


  if (!tables.next()) {
                        throw new IllegalArgumentException(
                                "Table with the name \""
                                        + tableName
                                        + "\" was not found. Check your database contents.");
                    }

[color=#f60808]

SEVERE: Terminal error:
com.vaadin.event.ListenerMethod$MethodException
Cause: java.lang.IllegalArgumentException: Table with the name “ETRAN.ORG_PASSPORT@LNK_ARC” was not found. Check your database contents.
[/color]

Ok, your debugging seems to indicate no tables are found. Are you sure that the “org_passport@lnk_arc” is actually the table name? Because from what I’ve understood the @ refers to a database link in Oracle and I’m quite sure these can not be found with the DatabaseMetaData in the normal way.

Does it work if you create a table without special characters, e.g. “footable” into the same schema? It would confirm that the url and schema name are correct and that the connection works otherwise ok.


Tepi

I welcome you, Teppo Kurki!

Yes, you have appeared are right,
org_passport@lnk_arc
is a table of external system. Therefore, actually, in target it also hasn’t been found.:smiley:

Many thanks once again!