use of com.kyj.fx.voeditor.visual.component.sql.dbtree.commons.DatabaseItemTree in project Gargoyle by callakrsos.
the class PostgreSqlPane method apply.
@Override
public TreeItem<DatabaseItemTree<String>> apply(String t, Supplier<Connection> conSupplier) {
try {
DatabaseItemTree<String> databaseItemTree = new PostgreDatabaseItemTree("databases", conSupplier);
TreeItem<DatabaseItemTree<String>> createNode = new DatabaseTreeNode().createNode(databaseItemTree);
return createNode;
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
use of com.kyj.fx.voeditor.visual.component.sql.dbtree.commons.DatabaseItemTree in project Gargoyle by callakrsos.
the class MysqlPane method showEditableDataAction.
/**
* @작성자 : KYJ
* @작성일 : 2016. 11. 25.
*/
@Override
public void showEditableDataAction() {
// Default TableName
TreeItem<DatabaseItemTree<String>> selectedItem = getSchemaTree().getSelectionModel().getSelectedItem();
if (null != selectedItem) {
DatabaseItemTree<String> value = selectedItem.getValue();
if (value instanceof TableItemTree) {
@SuppressWarnings("rawtypes") TableItemTree tableItemTree = (TableItemTree) value;
String schemaName = tableItemTree.getParent().getName();
String tableName = tableItemTree.getName();
String sql = String.format("edit `%s`.%s", schemaName, tableName);
execiteEdit(sql);
}
}
}
use of com.kyj.fx.voeditor.visual.component.sql.dbtree.commons.DatabaseItemTree in project Gargoyle by callakrsos.
the class MysqlPane method apply.
@Override
public TreeItem<DatabaseItemTree<String>> apply(String t, Supplier<Connection> conSupplier) {
try {
DatabaseItemTree<String> databaseItemTree = new MySQLDatabaseItemTree("databases", conSupplier);
TreeItem<DatabaseItemTree<String>> createNode = new DatabaseTreeNode().createNode(databaseItemTree);
return createNode;
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
use of com.kyj.fx.voeditor.visual.component.sql.dbtree.commons.DatabaseItemTree in project Gargoyle by callakrsos.
the class OracleSqlPane method apply.
@Override
public TreeItem<DatabaseItemTree<String>> apply(String t, Supplier<Connection> conSupplier) {
try {
DatabaseItemTree<String> databaseItemTree = new OracleDatabaseItemTree("databases", conSupplier);
TreeItem<DatabaseItemTree<String>> createNode = new DatabaseTreeNode().createNode(databaseItemTree);
return createNode;
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
use of com.kyj.fx.voeditor.visual.component.sql.dbtree.commons.DatabaseItemTree in project Gargoyle by callakrsos.
the class SqliteSchemaItemTree method applyChildren.
/**
* 커넥션으로부터 스키마 정보 출력
*/
@Override
public ObservableList<TreeItem<DatabaseItemTree<String>>> applyChildren(Connection con, String... args) throws Exception {
DatabaseMetaData metaData = con.getMetaData();
ResultSet tables = metaData.getTables(null, null, "%", null);
ObservableList<TreeItem<DatabaseItemTree<String>>> observableArrayList = FXCollections.observableArrayList();
while (tables.next()) {
String tableType = tables.getString(4);
if ("TABLE".equals(tableType)) {
LOGGER.debug("TABLE_CAT: {} TABLE_SCHEM: {} TABLE_NAME : {} TABLE_TYPE : {} ", tables.getString(1), tables.getString(2), tables.getString(3), tableType);
SqliteTableItemTree mysqlSchemaItemTree = new SqliteTableItemTree(this, tables.getString(3));
TreeItem<DatabaseItemTree<String>> treeItem = new TreeItem<>(mysqlSchemaItemTree);
observableArrayList.add(treeItem);
}
}
return observableArrayList;
}
Aggregations