Examples of IDatabaseObjectInfo


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

   }

   public static IDatabaseObjectInfo getEasyMockDatabaseObjectInfo(
         String catalog, String schema, String simpleName, String qualName,
         DatabaseObjectType type) {
      IDatabaseObjectInfo result = EasyMock.createMock(IDatabaseObjectInfo.class);
      expect(result.getCatalogName()).andReturn(catalog).anyTimes();
      expect(result.getSchemaName()).andReturn(schema).anyTimes();
      expect(result.getSimpleName()).andReturn(simpleName).anyTimes();
      expect(result.getQualifiedName()).andReturn(qualName).anyTimes();
      expect(result.getDatabaseObjectType()).andReturn(type).anyTimes();
      replay(result);
      return result;
   }
View Full Code Here

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

  }

  @Override
  protected PreparedStatement createStatement() throws SQLException {
    final ISession session = getSession();
    final IDatabaseObjectInfo doi = getDatabaseObjectInfo();

    ISQLConnection conn = session.getSQLConnection();
    PreparedStatement pstmt = conn.prepareStatement(SQL);
    pstmt.setString(1, doi.getSchemaName());
    pstmt.setString(2, doi.getSimpleName());
    return pstmt;
  }
View Full Code Here

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

     */
    @Override 
  protected PreparedStatement createStatement() throws SQLException
  {
    ISession session = getSession();
        IDatabaseObjectInfo doi = getDatabaseObjectInfo();
        if (s_log.isDebugEnabled()) {
            s_log.debug("Trigger details SQL: "+SQL);
            s_log.debug("Trigger schema: "+doi.getSchemaName());
            s_log.debug("Trigger name: "+doi.getSimpleName());
        }
    PreparedStatement pstmt = session.getSQLConnection().prepareStatement(SQL);
        pstmt.setString(1, doi.getSchemaName());
    pstmt.setString(2, doi.getSimpleName());
    return pstmt;
  }
View Full Code Here

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

    throws SQLException
  {
    final List<ObjectTreeNode> childNodes = new ArrayList<ObjectTreeNode>();
    final ISQLConnection conn = session.getSQLConnection();
    final SQLDatabaseMetaData md = session.getSQLConnection().getSQLMetaData();
    final IDatabaseObjectInfo parentDbinfo = parentNode.getDatabaseObjectInfo();
    final String schemaName = parentDbinfo.getSchemaName();

    PreparedStatement pstmt = conn.prepareStatement(SQL);
    try
    {
      ResultSet rs = pstmt.executeQuery();
      while (rs.next())
      {
        IDatabaseObjectInfo doi = new DatabaseObjectInfo(null, schemaName,
                      rs.getString(1), DatabaseObjectType.USER, md);
        childNodes.add(new ObjectTreeNode(session, doi));
      }
    }
    finally
View Full Code Here

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

   */
  @Override
  protected PreparedStatement createStatement() throws SQLException
  {
    ISession session = getSession();
        IDatabaseObjectInfo doi = getDatabaseObjectInfo();
        String sql = SQL;
        if (isOS400) {
            sql = OS_400_SQL;
        }
        if (s_log.isDebugEnabled()) {
            s_log.debug("UDF details SQL: "+sql);
            s_log.debug("UDF schema: "+doi.getSchemaName());
            s_log.debug("UDF name: "+doi.getSimpleName());
        }
    PreparedStatement pstmt = session.getSQLConnection().prepareStatement(sql);
        pstmt.setString(1, doi.getSchemaName());
    pstmt.setString(2, doi.getSimpleName());
    return pstmt;
  }
View Full Code Here

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

  }

  protected PreparedStatement createStatement() throws SQLException
  {
    final ISession session = getSession();
    final IDatabaseObjectInfo doi = getDatabaseObjectInfo();

    ISQLConnection conn = session.getSQLConnection();
    PreparedStatement pstmt = conn.prepareStatement(SQL);
    pstmt.setString(1, doi.getSchemaName());
    pstmt.setString(2, doi.getSimpleName());
    return pstmt;
  }
View Full Code Here

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

     */
    @Override 
  protected PreparedStatement createStatement() throws SQLException
  {       
    ISession session = getSession();
    IDatabaseObjectInfo doi = getDatabaseObjectInfo();
    String sql = SQL;
        if (isOS400) {
            sql = OS_400_SQL;
        }
        if (s_log.isDebugEnabled()) {
            s_log.debug("Sequence details SQL: "+sql);
            s_log.debug("Sequence schema: "+doi.getSchemaName());
            s_log.debug("Sequence name: "+doi.getSimpleName());
        }   
    PreparedStatement pstmt = session.getSQLConnection().prepareStatement(sql);
    pstmt.setString(1, doi.getSchemaName());
    pstmt.setString(2, doi.getSimpleName());
    return pstmt;
  }
View Full Code Here

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

  protected PreparedStatement createStatement() throws SQLException {
    ISession session = getSession();
    PreparedStatement pstmt = session.getSQLConnection().prepareStatement(
        SQL);
    IDatabaseObjectInfo doi = getDatabaseObjectInfo();
    pstmt.setString(1, doi.getSchemaName());
    pstmt.setString(2, doi.getSimpleName());
    return pstmt;
  }
View Full Code Here

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

     */
    @Override 
  protected PreparedStatement createStatement() throws SQLException
  {
    ISession session = getSession();
    IDatabaseObjectInfo doi = getDatabaseObjectInfo();
        String sql = SQL;
        if (isOS400) {
            sql = OS_400_SQL;
        }
        if (s_log.isDebugEnabled()) {
            s_log.debug("Running SQL for index details: "+sql);
            s_log.debug("schema="+doi.getSchemaName());
            s_log.debug("index name="+doi.getSimpleName());
        }
    PreparedStatement pstmt =
        session.getSQLConnection().prepareStatement(sql);   
    pstmt.setString(1, doi.getSchemaName());
    pstmt.setString(2, doi.getSimpleName());
    return pstmt;
  }
View Full Code Here

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

                final String sqlSep =
                    _session.getQueryTokenizer().getSQLStatementSeparator();
                final StringBuffer buf = new StringBuffer();

                for (int i = 0; i < _dbObjs.length; i++) {
                    final IDatabaseObjectInfo ti = _dbObjs[i];
                    /* TODO: what I really want to do here is get the SQL script and replace
                     * "CREATE PROCEDURE" with "ALTER PROCEDURE", then put that in the SQL pane
                     * and *NOT* execute it. */

                    /* NOTE: a procedure may also be a UDF! */
                   
                    if (!conn.getCatalog().equals(ti.getCatalogName()))
                        conn.setCatalog(ti.getCatalogName());
                   
                    buf.append(MssqlIntrospector.getHelpTextForObject(MssqlIntrospector.getFixedVersionedObjectName(ti.getSimpleName()),conn));
                    buf.append("\n");
                    buf.append(sqlSep);
                    buf.append("\n\n");
                }

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.