Package net.sourceforge.squirrel_sql.plugins.mssql.sql.dbfile

Examples of net.sourceforge.squirrel_sql.plugins.mssql.sql.dbfile.DatabaseFile


                        return;
                   
                    DatabaseFileInfo info = MssqlIntrospector.getDatabaseFileInfo(nodes[0].toString(), _session.getSQLConnection());
                    Object[] files = info.getDataFiles();
                    for (int i = 0; i < files.length; i++) {
                        DatabaseFile file = (DatabaseFile) files[i];
                        final ShrinkDatabaseFileAction shrinkDatabaseFileAction = new ShrinkDatabaseFileAction(app,_resources,plugin,nodes[0].toString(),file);
                        shrinkDatabaseFileAction.setSession(_session);
                        coll.add(shrinkDatabaseFileAction);
                        _resources.addToMenu(shrinkDatabaseFileAction,menu);
                    }
                    menu.addSeparator();
                    files = info.getLogFiles();
                    for (int i = 0; i < files.length; i++) {
                        DatabaseFile file = (DatabaseFile) files[i];
                        final ShrinkDatabaseFileAction shrinkDatabaseFileAction = new ShrinkDatabaseFileAction(app,_resources,plugin,nodes[0].toString(),file);
                        shrinkDatabaseFileAction.setSession(_session);
                        coll.add(shrinkDatabaseFileAction);
                        _resources.addToMenu(shrinkDatabaseFileAction,menu);
                    }
View Full Code Here


        String size = rs.getString(5);
        String maxSize = rs.getString(6);
        String growth = rs.getString(7);
        String usage = rs.getString(8);

        DatabaseFile file = new DatabaseFile();
        file.setName(name);
        file.setId(id);
        file.setFilename(filename);
        file.setFilegroup(filegroup);
        file.setSize(size);
        file.setMaxSize(maxSize);
        file.setGrowth(growth);
        file.setUsage(usage);

        if (filegroup == null) dbInfo.addLogFile(file);
        else dbInfo.addDataFile(file);
      }
    }
View Full Code Here

    buf.append("]\nON ");

    String lastFilegroup = "";
    for (int i = 0; i < dataFiles.length; i++)
    {
      DatabaseFile file = (DatabaseFile) dataFiles[i];

      String thisFilegroup = file.getFilegroup();
      if (!thisFilegroup.equals(lastFilegroup))
      {
        // if it's PRIMARY, just write it without the FILEGROUP prefix.
        if (thisFilegroup.equals("PRIMARY")) buf.append("PRIMARY");
        else
        {
          buf.append("FILEGROUP ");
          buf.append(thisFilegroup);
        }
        buf.append("\n");
        lastFilegroup = thisFilegroup;
      }

      buf.append("( NAME = ");
      buf.append(file.getName());
      buf.append(",\n\tFILENAME = '");
      buf.append(file.getFilename());
      buf.append("',\n\tSIZE = ");
      buf.append(file.getSize());
      if (!file.getMaxSize().equals("Unlimited"))
      {
        buf.append(",\n\tMAXSIZE = ");
        buf.append(file.getMaxSize());
      }
      buf.append(",\n\tFILEGROWTH = ");
      buf.append(file.getGrowth());
      buf.append(" )");

      if (i < dataFiles.length - 1) buf.append(",");
      buf.append("\n");
    }

    buf.append("LOG ON\n");
    for (int i = 0; i < logFiles.length; i++)
    {
      DatabaseFile file = (DatabaseFile) logFiles[i];

      buf.append("( NAME = ");
      buf.append(file.getName());
      buf.append(",\n\tFILENAME = '");
      buf.append(file.getFilename());
      buf.append("',\n\tSIZE = ");
      buf.append(file.getSize());
      if (!file.getMaxSize().equals("Unlimited"))
      {
        buf.append(",\n\tMAXSIZE = ");
        buf.append(file.getMaxSize());
      }
      buf.append(",\n\tFILEGROWTH = ");
      buf.append(file.getGrowth());
      buf.append(" )");

      if (i < logFiles.length - 1) buf.append(",");

      buf.append("\n");
View Full Code Here

TOP

Related Classes of net.sourceforge.squirrel_sql.plugins.mssql.sql.dbfile.DatabaseFile

Copyright © 2018 www.massapicom. 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.