Examples of IDatabaseObjectInfo


Examples of net.sourceforge.squirrel_sql.fw.sql.IDatabaseObjectInfo

     * This adds a node to the tree that says "Loading..." in order to give
     * feedback to the user.
     */
    private ObjectTreeNode showLoadingNode()
    {
      IDatabaseObjectInfo doi = new DatabaseObjectInfo(null, null,
                "Loading...", DatabaseObjectType.OTHER,
                _session.getSQLConnection().getSQLMetaData());
      ObjectTreeNode loadingNode = new ObjectTreeNode(_session, doi);
      _parentNode.add(loadingNode);
      fireStructureChanged(_parentNode);
View Full Code Here

Examples of net.sourceforge.squirrel_sql.fw.sql.IDatabaseObjectInfo

   */
  public List<ObjectTreeNode> createChildren(ISession session, ObjectTreeNode parentNode)
    throws SQLException
  {
    final List<ObjectTreeNode> childNodes = new ArrayList<ObjectTreeNode>();
    final IDatabaseObjectInfo parentDbinfo = parentNode.getDatabaseObjectInfo();
    final ISQLConnection conn = session.getSQLConnection();
    final SQLDatabaseMetaData md = session.getSQLConnection().getSQLMetaData();
    final String catalogName = parentDbinfo.getCatalogName();
    final String schemaName = parentDbinfo.getSchemaName();
    final ObjFilterMatcher filterMatcher = new ObjFilterMatcher(session.getProperties());

    final String sequenceParentQuerySql = extractor.getSequenceParentQuery();
    if (s_log.isDebugEnabled()) {
      s_log.debug("createChildren: running sequence parent query for sequence children: "
        + sequenceParentQuerySql);
    }

    PreparedStatement pstmt = null;
    ResultSet rs = null;
    try
    {
      pstmt = conn.prepareStatement(sequenceParentQuerySql);   
      extractor.bindParameters(pstmt, parentDbinfo, filterMatcher);

      rs = pstmt.executeQuery();
      while (rs.next())
      {
        final IDatabaseObjectInfo si =
          new DatabaseObjectInfo(catalogName, schemaName, rs.getString(1), DatabaseObjectType.SEQUENCE,
            md);
        if (filterMatcher.matches(si.getSimpleName()))
        {
          childNodes.add(new ObjectTreeNode(session, si));
        }
      }
    }
View Full Code Here

Examples of net.sourceforge.squirrel_sql.fw.sql.IDatabaseObjectInfo

   */
  public List<ObjectTreeNode> createChildren(ISession session,
                                               ObjectTreeNode parentNode)
    throws SQLException
  {
    final IDatabaseObjectInfo parentDbinfo = parentNode.getDatabaseObjectInfo();
    final String catalogName = parentDbinfo.getCatalogName();
    final String schemaName = parentDbinfo.getSchemaName();

    return createProcedureNodes(session, catalogName, schemaName);
  }
View Full Code Here

Examples of net.sourceforge.squirrel_sql.fw.sql.IDatabaseObjectInfo

   *         Thrown if an SQL error occurs.
   */
  public List<ObjectTreeNode> createChildren(ISession session, ObjectTreeNode parentNode)
  {
    final List<ObjectTreeNode> childNodes = new ArrayList<ObjectTreeNode>();
    final IDatabaseObjectInfo parentDbinfo = parentNode.getDatabaseObjectInfo();
    final IDatabaseObjectInfo tableInfo = ((IndexParentInfo) parentDbinfo).getTableInfo();

    final ISQLConnection conn = session.getSQLConnection();
    final SQLDatabaseMetaData md = session.getSQLConnection().getSQLMetaData();
    PreparedStatement pstmt = null;
    ResultSet rs = null;
    try
    {
      String query = extractor.getTableIndexQuery();
      if (s_log.isDebugEnabled())
      {
        s_log.debug("Running query for index extraction: " + query);
      }
      pstmt = conn.prepareStatement(query);
      extractor.bindParamters(pstmt, tableInfo);
      rs = pstmt.executeQuery();
      while (rs.next())
      {
        String indexName = rs.getString(1);
        String cat = parentDbinfo.getCatalogName();
        String schema = parentDbinfo.getSchemaName();
        String tableName = tableInfo.getSimpleName();
        // This info is merely a placeholder in the tree that we can use to get index name and
        // parent name more easily. We probably should create a IndexColumnInfo that has this
        // extra info in it.
        String columnName = null;
        boolean nonUnique = true;
View Full Code Here

Examples of net.sourceforge.squirrel_sql.fw.sql.IDatabaseObjectInfo

  {
    final List<ObjectTreeNode> childNodes = new ArrayList<ObjectTreeNode>();
    Statement stmt = null;
    try
    {
      final IDatabaseObjectInfo parentDbinfo = parentNode.getDatabaseObjectInfo();
      final ISQLConnection conn = session.getSQLConnection();
      final String catalogName = parentDbinfo.getCatalogName();
      final String schemaName = parentDbinfo.getSchemaName();
      final String tableType = parentDbinfo.getSimpleName();

      String[] types = tableType != null ? new String[] { tableType } : null;
      session.getSchemaInfo().waitTillTablesLoaded();
      final ITableInfo[] tables =
        session.getSchemaInfo().getITableInfos(catalogName, schemaName,
View Full Code Here

Examples of net.sourceforge.squirrel_sql.fw.sql.IDatabaseObjectInfo

  public List<ObjectTreeNode> createChildren(ISession session,
                                               ObjectTreeNode parentNode)
    throws SQLException
  {
    final List<ObjectTreeNode> childNodes = new ArrayList<ObjectTreeNode>();
    final IDatabaseObjectInfo parentDbinfo = parentNode.getDatabaseObjectInfo();
    final ISQLConnection conn = session.getSQLConnection();
    final String catalogName = parentDbinfo.getCatalogName();
    final String schemaName = parentDbinfo.getSchemaName();

      ObjFilterMatcher filterMatcher = new ObjFilterMatcher(session.getProperties());

      IUDTInfo[] udts =
         conn.getSQLMetaData().getUDTs(catalogName, schemaName, filterMatcher.getSqlLikeMatchString(), null);
View Full Code Here

Examples of net.sourceforge.squirrel_sql.fw.sql.IDatabaseObjectInfo

   *
   * @return a String array of bind variable values
   */
  protected String[] getBindValues()
  {
    final IDatabaseObjectInfo doi = getDatabaseObjectInfo();
    return new String[] { doi.getSchemaName(), doi.getSimpleName() };
  }
View Full Code Here

Examples of net.sourceforge.squirrel_sql.fw.sql.IDatabaseObjectInfo

    * Expands the specified tree node.
    *
    * @param node the tree node to expand
    */   
    public void expandNode(ObjectTreeNode node) {
        IDatabaseObjectInfo info = node.getDatabaseObjectInfo();
        TreePath path = getTreePath(info.getCatalogName(),
                                    info.getSchemaName(),
                                    new FilterMatcher(info.getSimpleName(), null));   
        _tree.fireTreeExpanded(path);
    }
View Full Code Here

Examples of net.sourceforge.squirrel_sql.fw.sql.IDatabaseObjectInfo

    public void testMatchKeyPrefixDeletedRows() {
        Map<String, Object> map = new HashMap<String, Object>();
        String tableKey = "table(100)";
        map.put(tableKey, null);
       
        IDatabaseObjectInfo dbInfo =
            FwTestUtil.getEasyMockDatabaseObjectInfo("catalog",
                                                   "schema",
                                                   "table",
                                                   "schema.table",
                                                   DatabaseObjectType.TABLE);
View Full Code Here

Examples of net.sourceforge.squirrel_sql.fw.sql.IDatabaseObjectInfo

  }

  @Test
  public void testCanPasteTo() throws Exception
  {
    IDatabaseObjectInfo mockDboInfo = mockHelper.createMock(IDatabaseObjectInfo.class);
    boolean canPasteTo = false;
    DatabaseObjectType t = DatabaseObjectType.DATABASE_TYPE_DBO;
    for (Field f : t.getClass().getFields())
    {
      if (Modifier.isPublic(f.getModifiers()))
      {
        Object o = f.get(t);
        expect(mockDboInfo.getDatabaseObjectType()).andStubReturn((DatabaseObjectType) (o));
        mockHelper.replayAll();
        canPasteTo = canPasteTo || classUnderTest.canPasteTo(mockDboInfo);
        mockHelper.resetAll();
      }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.