}
// if (ExternalInterface.isBookmarkConnected(bookmarkString)) {
try {
- // Connection connection = bookmark.getConnection();
- // DatabaseMetaData metaData = connection.getMetaData();
-
- // if (metaData != null) {
- int start = context.getStart();
+ int start = context.getStart();
int end = context.getEnd();
String foundSQLTableName = sqlTable.getTableName();
String tableName;
for (int i = 0; i < tableNames.length; i++) {
sqlList.add(new SQLProposal(tableNames[i], context, region, viewer, PHPUiImages.get(PHPUiImages.IMG_TABLE)));
}
-
- // set = metaData.getTables(null, null, prefixWithoutDollar + "%", null);
- // while (set.next()) {
- // tableName = set.getString("TABLE_NAME");
- // tableName = (tableName == null) ? "" : tableName.trim();
- // if (tableName != null && tableName.length() > 0) {
- // sqlList.add(new SQLProposal(tableName, context, region, viewer, PHPUiImages.get(PHPUiImages.IMG_TABLE)));
- // }
- // }
- // set.close();
}
String[] columnNames = ExternalInterface.getMatchingColumnNames(null, bookmarkString, prefixWithoutDollar, null, false);
for (int i = 0; i < columnNames.length; i++) {
sqlList.add(new SQLProposal(columnNames[i], context, region, viewer, PHPUiImages.get(PHPUiImages.IMG_TABLE)));
}
- // set = metaData.getColumns(null, null, "%", prefixWithoutDollar + "%");
- // SQLProposal sqlProposal;
- // while (set.next()) {
- // columnName = set.getString("COLUMN_NAME");
- // columnName = (columnName == null) ? "" : columnName.trim();
- // tableName = set.getString("TABLE_NAME");
- // tableName = (tableName == null) ? "" : tableName.trim();
- // if (tableName != null && tableName.length() > 0 && columnName != null && columnName.length() > 0) {
- // if (isDollarPrefix) {
- // sqlProposal = new SQLProposal(tableName, "$" + columnName, context, region, viewer, PHPUiImages
- // .get(PHPUiImages.IMG_COLUMN));
- // } else {
- // sqlProposal = new SQLProposal(tableName, columnName, context, region, viewer, PHPUiImages
- // .get(PHPUiImages.IMG_COLUMN));
- // }
- // if (tableName.equals(foundSQLTableName)) {
- // sqlProposal.setRelevance(90);
- // } else if (tableName.indexOf(foundSQLTableName) >= 0) {
- // sqlProposal.setRelevance(75);
- // }
- // sqlList.add(sqlProposal);
- // }
- // }
- // set.close();
+
sqlResults = new IPHPCompletionProposal[sqlList.size()];
for (int i = 0; i < sqlList.size(); i++) {
sqlResults[i] = (SQLProposal) sqlList.get(i);
}
- // }
} catch (Exception /* NotConnectedException */ e) {
- // ignore this - not mission critical
- // } catch (SQLException e) {
- // e.printStackTrace();
+
}
// }
}