I m using JSQLPARSER for the first time and I wonder if it s possible to detect remote links (oracle dblink)?
If for example a simple select * from table1@remote
I m using JSQLPARSER for the first time and I wonder if it s possible to detect remote links (oracle dblink)?
If for example a simple select * from table1@remote
For JSqlParser this would be no special identifier. However, it will accept it as a normal table name. You could extract all used table names using something like:
String sql = "select * from table1@remote";
Statement stmt = CCJSqlParserUtil.parse(sql);
TablesNamesFinder tablesNamesFinder = new TablesNamesFinder();
List<String> tableList = tablesNamesFinder.getTableList(stmt);
assertEquals(1, tableList.size());
assertTrue(tableList.contains("table1@remote"));
And after that, you have to check, like I did with junits assertions, if a table name matches remote dblink syntax.