File count is incorrect

I have a windows 7 Pro desktop that is up to date. Attached to it is a RAID 5 hardware array that has 5x1GB drives. It contains a large number of files that are roughly 200-300 MB in size spread through about 7000 subdirs. If I search for the files in
windows explorer it always tells me I have 63477 files regardless of whether I remove or add some. I have even waited some time (a couple of hours) with no chane. It has been doing this for the last week. Any ideas on what is causing this

Goto control panel and select indexing options. Check that the drive is selected. If this doesnt help you can try to rebuild the index.

Similar Messages

  • How can I resolve Exception : "Count Field Incorrect" error

    Hi all,
    I am experiencing with "Count Field incorrect" error. What's wrong with it? How can I resolve it?
    This error is occured at UPDATE function of SQL. My JSP page is to update the old record.
    Sometimes, "Update statement error" message appear. These two problems I always confusing.
    What are the possible point of these error in my Java file and JSP page? I use package import to JSP Page.
    Pls help me.
    With thanks,

    Thanks,
    Your URLs help me exectly. But after I have changed my code, the error is changed to "Too Few Parameters : Expected 35". What's wrong with it? The following is my code.
    try {                                                                                                                                                                                                                
    String DRIVER = ("sun.jdbc.odbc.JdbcOdbcDriver");               
    String URL = "jdbc:odbc:Industrial_One_DSN";
    String sql = "UPDATE BusinessRegistration " +
    "SET [Date] = ?, ISIC = ?, BizName = ?, BizAddress = ?, " +
    "OwnerName = ?, OwnerNRC = ?, Investment = ?, EstablishedYear = ?, " +
    "L_Male = ?, L_Female = ?, F_Male = ?, F_Female = ?, " +
    "OwnershipType = ?, Remarks = ?, IndustialZoneName = ?, Unit = ?, " +
    "Fuel = ?, FactoryType = ?, FactoryName = ?, Township = ? " +
    "MainProductName = ?, MainProductCountType = ?, " +
    "MainProductQuantity = ?, MainProductValue = ?, RMName = ?, " +
    "RMCountType = ?, RMQuantity = ?, RMValue = ?, EnergyName = ?, " +
    "MachinePower = ?, AmountGallon = ?, StateDiv = ?, BizSize = ?  " +
    "WHERE RegistrationID = ?";
    Class.forName(DRIVER);
    Connection con = DriverManager.getConnection(URL);
    PreparedStatement pstmt = con.prepareStatement(sql);
    int ilmale = Integer.parseInt(lmale);
    int ilfemale = Integer.parseInt(lfemale);
    int ifmale = Integer.parseInt(fmale);
    int iffemale = Integer.parseInt(ffemale);
    int impq = Integer.parseInt(mpq);
    int impv = Integer.parseInt(mpv);
    int irmq = Integer.parseInt(rmq);
    int irmv = Integer.parseInt(rmv);
    int iamountgallon = Integer.parseInt(amountgallon);
    pstmt.setString(1, date);
    pstmt.setString(2, isic);
    pstmt.setString(3, bizname);
    pstmt.setString(4, bizaddress);
    pstmt.setString(5, ownername);
    pstmt.setString(6, ownernrc);
    pstmt.setString(7, investment);
    pstmt.setString(8, eyear);
    pstmt.setInt(9, ilmale);
    pstmt.setInt(10, ilfemale);
    pstmt.setInt(11, ifmale);
    pstmt.setInt(12, iffemale);
    pstmt.setString(13, ownershiptype);
    pstmt.setString(14, remark);
    pstmt.setString(15, izn);
    pstmt.setString(16, unit);
    pstmt.setString(17, fuel);
    pstmt.setString(18, ft);
    pstmt.setString(19, fname);
    pstmt.setString(20, township);
    pstmt.setString(21, mpn);
    pstmt.setString(22, mpct);
    pstmt.setInt(23, impq);               
    pstmt.setInt(24, impv);
    pstmt.setString(25, rmname);
    pstmt.setString(26, rmct);
    pstmt.setInt(27, irmq);
    pstmt.setInt(28, irmv);
    pstmt.setString(29, ename);
    pstmt.setString(30, mpower);
    pstmt.setInt(31, iamountgallon);
    pstmt.setString(32, statediv);
    pstmt.setString(33, bizsize);
    pstmt.setInt(34, Integer.parseInt(rid));
    pstmt.executeUpdate();
    }I have got 35 fields in my db. But i wanna edit 34 fields only. I have no primary key in my table. Is't alright?
    pls keep on helping me.
    With thanks,
    WTDAHL

  • File Adapter - how to get the file count from a folder

    Hi All,
    I have a requirement that have to poll a directory when the file count is reached to number N (ex:number of files avilable in folder is 5) otherwise it should wait and not pick any of the files. Is it possible to get the file count from a folder using file adapter ?? otherwise please suggest me an approach to achieve this requirement.
    Thanks,
    JJ

    Hi Sarath,
    Thank you for your reply.
    Go with the list files operation of file adapter it will gives you the number of files in the specified folder as you given. . - this step is already done.
    When the number of files reaches your count startup your webservice that which can polls the files. . . - how can i acheive this?? Have to poll the directory and process the number files - please let me know, what could be added to the webservice which is being invoked after cheking file count from parent process.
    The reason for the above question is - we cannot use ReadFile operation in second webservice because it will be automatically triggered when the file is avilable. Also SyncRead operation supports reading one file in b/w bpel process. Kindly explain me the implementation steps.
    Thanks,
    JJ

  • File Count with selected date range

    Hi,
    Our requirement is to get the file count with selected date by the user from two sharepoint date time controls i.e. dtp1 and dtp2 into the data table. I am able to get the file count of specific folder from Pages library through below code. Now need to get
    the selected date range from two date time picker controls and check with the item created by is within the date range. If yes I need to get the file count.
    So please share your ideas/thoughts to do the same.
    SPList list =
    wikiweb.Lists["Pages"];
                        SPFolderCollection oFolders
    = list.RootFolder.SubFolders["foldername"].SubFolders;
                        DataTable dt
    = new DataTable();
                        dt.Columns.Add("Column1");
                        DataRow dr;
                        if (oFolders.Count
    > 0)
                            foreach (SPFolder oFolder in oFolders)
     if (!oFolder.Name.Equals("Forms"))
                                    dr
    = dt.NewRow(); 
    dr["Column1"] = oFolder.ItemCount.ToString();
    dt.Rows.Add(dr);
    Regards,
    Sudheer
    Thanks & Regards, Sudheer

    Hi,
    I have modified the code as below
    if((DateTime)(oFolder.Item.File.TimeCreated>dtFromDate.SelectedDate)&&(DateTime)(oFolder.Item.File.TimeCreated<dtToDate.SelectedDate))
    But still it is throwing the error.
    Please share your ideas on the same.
    Regards,
    Sudheer
    Thanks & Regards, Sudheer

  • Where is the file count in a finder window?

    Where is the file count in a finder window now?  I have nothing in any of the view modes.

    From the Finder Menu bar View > Show status bar

  • Database Access in Java (Count field incorrect)

    Was given a stock tracking application to be edited for use as a Student/Admin login application which accesses a database and adds/deletes/edits student information. When I try to login, I get the following error: [Microsoft][OBDC Microsoft Access Driver]Count Field Incorrect
    The driver was set up in the Admin tools in Windows XP.
    The columns exist in the database.
    //makeDB.java
      import java.sql.*;
      import java.io.*;
      public class MakeDB
        public static void main(String[] args) throws Exception
          Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
              String url = "jdbc:odbc:saad";
              Connection con = DriverManager.getConnection(url);
             Statement stmt = con.createStatement();
              // The following code deletes each index and table, if they exist.
              // If they do not exist, a message is displayed and execution continues.
              System.out.println("Dropping indexes & tables ...");
            try
                   stmt.executeUpdate("DROP INDEX PK_StudentUserBridge ON StudentUserBridge");
             catch (Exception e)
                   System.out.println("Could not drop primary key on saad table: "
                                     + e.getMessage());
            try
                     stmt.executeUpdate("DROP TABLE Student");
             catch (Exception e)
                   System.out.println("Could not drop Student table: "
                                     + e.getMessage());
            try
                     stmt.executeUpdate("DROP TABLE Users");
             catch (Exception e)
                   System.out.println("Could not drop Users table: "
                                     + e.getMessage());
            try
                     stmt.executeUpdate("DROP TABLE StudentUserBridge");
             catch (Exception e)
                   System.out.println("Could not drop StudentUserBridge table: "
                                     + e.getMessage());
              ///////// Create the database tables /////////////
              System.out.println("\nCreating tables ............");
              // Create Stocks table with primary key index
            try
                   System.out.println("Creating Student table with primary key index...");
                   stmt.executeUpdate("CREATE TABLE Student ("
                                     +"IDNumber TEXT(8) NOT NULL "
                                     +"CONSTRAINT PK_Student PRIMARY KEY, "
                                     +"FirstName TEXT(50), "
                                     +"LastName TEXT(50)"
                                     +")");
             catch (Exception e)
                   System.out.println("Exception creating Student table: "
                                     + e.getMessage());
              // Create Users table with primary key index
            try
                   System.out.println("Creating Users table with primary key index...");
                   stmt.executeUpdate("CREATE TABLE Users ("
                                     +"userID TEXT(20) NOT NULL "
                                    +"CONSTRAINT PK_Users PRIMARY KEY, "
                                    +"FirstName TEXT(30) NOT NULL, "
                                    +"LastName TEXT(30) NOT NULL, "
                                         +"pswd LONGBINARY, "
                                    +"email TEXT(30) NOT NULL, "
                                         +"admin BIT"
                                         +")");
             catch (Exception e)
                   System.out.println("Exception creating Users table: "
                                     + e.getMessage());
              // Create UserStocks table with foreign keys to Users and Stocks tables
            try
                   System.out.println("Creating StudentUserBridge table ...");
                   stmt.executeUpdate("CREATE TABLE StudentUserBridge ("
                                     +"userID TEXT(20) "
                                       +"CONSTRAINT FK1_StudentUserBridge REFERENCES Users (userID), "
                                          +"IDNumber TEXT(8), "
                                       +"CONSTRAINT FK2_StudentUserBridge FOREIGN KEY (IDNumber) "
                                       +"REFERENCES Student (IDNumber)"
                                       +")");
             catch (Exception e)
                   System.out.println("Exception creating StudentUserBridge table: "
                                     + e.getMessage());
              // Create UserStocks table primary key index
            try
                   System.out.println("Creating StudentUserBridge table primary key index...");
                   stmt.executeUpdate("CREATE UNIQUE INDEX PK_StudentUserBridge "
                                        +"ON StudentUserBridge (userID, IDNumber) "
                                        +"WITH PRIMARY DISALLOW NULL");
             catch (Exception e)
                   System.out.println("Exception creating StudentUserBridge index: "
                                     + e.getMessage());
              // Create one administrative user with password as initial data
              String userID = "admin01";
              String FirstName = "Default";
              String LastName = "Admin";
              String initialPswd = "admin01";
              String email = "[email protected]";
              Password pswd = new Password(initialPswd);
              boolean admin = true;
            PreparedStatement pStmt =
                       con.prepareStatement("INSERT INTO Users VALUES (?,?,?,?,?,?)");
            try
                 pStmt.setString(1, userID);
                  pStmt.setString(2, FirstName);
                  pStmt.setString(3, LastName);
                pStmt.setBytes(4, serializeObj(pswd));
                pStmt.setString(5, email);
                  pStmt.setBoolean(6, admin);
                  pStmt.executeUpdate();
              catch (Exception e)
                   System.out.println("Exception inserting user: "
                                     + e.getMessage());
            pStmt.close();
              // Read and display all User data in the database.
            ResultSet rs = stmt.executeQuery("SELECT * FROM Users");
            System.out.println("Database created.\n");
            System.out.println("Displaying data from database...\n");
            System.out.println("Users table contains:");
            Password pswdFromDB;
            byte[] buf = null;
            while(rs.next())
                   System.out.println("Logon ID         = "
                                     + rs.getString("userID"));
                 System.out.println("Last name        = "
                                   + rs.getString("FirstName"));
                 System.out.println("First name       = "+rs.getString("LastName"));
                 System.out.println("E-mail           = "+rs.getString("email"));
                 System.out.println("Administrative   = "+rs.getBoolean("admin"));
                 System.out.println("Initial password = "+initialPswd);
            // Do NOT use with JDK 1.2.2 using JDBC-ODBC bridge as
            // SQL NULL data value is not handled correctly.
                buf = rs.getBytes("pswd");
                if (buf != null)
                      System.out.println("Password Object  = "
                                      + (pswdFromDB=(Password)deserializeObj(buf)));
                      System.out.println("  AutoExpires    = "+ pswdFromDB.getAutoExpires());
                      System.out.println("  Expiring now   = "+ pswdFromDB.isExpiring());
                      System.out.println("  Remaining uses = "
                                        + pswdFromDB.getRemainingUses()+"\n");
                  else
                      System.out.println("Password Object  = NULL!");
            rs = stmt.executeQuery("SELECT * FROM Student");
            if(!rs.next())
                 System.out.println("Student table contains no records.");
              else
                 System.out.println("Student table still contains records!");
            rs = stmt.executeQuery("SELECT * FROM StudentUserBridge");
            if(!rs.next())
                 System.out.println("StudentUserBridge table contains no records.");
              else
                 System.out.println("StudentUserBridge table still contains records!");
             stmt.close(); // closing Statement also closes ResultSet
        } // end of main()
         // Method to write object to byte array and then insert into prepared statement
        public static byte[] serializeObj(Object obj)
                                  throws IOException
              ByteArrayOutputStream baOStream = new ByteArrayOutputStream();
            ObjectOutputStream objOStream = new ObjectOutputStream(baOStream);
            objOStream.writeObject(obj); // object must be Serializable
            objOStream.flush();
            objOStream.close();
            return baOStream.toByteArray(); // returns stream as byte array
         // Method to read bytes from result set into a byte array and then
         // create an input stream and read the data into an object
        public static Object deserializeObj(byte[] buf)
                                      throws IOException, ClassNotFoundException
             Object obj = null;
            if (buf != null)
              ObjectInputStream objIStream =
                new ObjectInputStream(new ByteArrayInputStream(buf));
              obj = objIStream.readObject(); // throws IOException, ClassNotFoundException
            return obj;
      } // end of class
    //STLogon.java
    import javax.swing.*;
    import javax.swing.border.TitledBorder;
    import java.awt.*;
    import java.awt.event.*;
    import java.util.*;
    import java.io.*;
    import java.sql.*;
    public class STLogon extends JFrame implements ActionListener, Activator
        StudentDB db;
        User user = null;
        String userID;
        String password;
        JTextField userIDField;
        JPasswordField passwordField;
        JButton jbtLogon;
        public STLogon()
            super("Stock Tracker"); // call super (JFrame) constructor
              int width = 300;
              int height = 100;
            try{
                 db = new StudentDB();
            catch(ClassNotFoundException ex){
                        JOptionPane.showMessageDialog(this,
                    ex.getMessage(),
                    "Class not found exception creating database object",
                    JOptionPane.ERROR_MESSAGE);
                           System.exit(0);
            catch(SQLException ex){
                        JOptionPane.showMessageDialog(this,
                    ex.getMessage(),
                    "SQL exception creating database object",
                    JOptionPane.ERROR_MESSAGE);
                           System.exit(0);
              // define GUI components
            JLabel label1 = new JLabel("User ID: ");
            userIDField = new JTextField(20);
            JLabel label2 = new JLabel("Password:   ");
            passwordField = new JPasswordField(20);
            passwordField.setEchoChar('*');
            jbtLogon = new JButton("Log on");
              // set up GUI
            JPanel userPanel= new JPanel(new BorderLayout());
            userPanel.add(label1,BorderLayout.CENTER);
            userPanel.add(userIDField,BorderLayout.EAST);
            JPanel pswdPanel= new JPanel(new BorderLayout());
            pswdPanel.add(label2,BorderLayout.CENTER);
            pswdPanel.add(passwordField,BorderLayout.EAST);
            JPanel buttonPanel= new JPanel(new FlowLayout());
            buttonPanel.add(jbtLogon);
            JPanel contentPanel= new JPanel(new BorderLayout());
            contentPanel.add(userPanel, BorderLayout.NORTH);
            contentPanel.add(pswdPanel, BorderLayout.CENTER);
            contentPanel.add(buttonPanel, BorderLayout.SOUTH);
             contentPanel.setBorder(new TitledBorder("Log on"));
            setContentPane(contentPanel);
            // add listeners
            jbtLogon.addActionListener(this);
            addWindowListener(new WindowAdapter() {
                public void windowClosing(WindowEvent e)
                                       try {db.close();
                                    catch(Exception ex)
                                    System.exit(0);
              // Enable Enter key for each JButton
              InputMap map;
              map = jbtLogon.getInputMap();
              if (map != null){
                   map.put(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER,0,false), "pressed");
                   map.put(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER,0,true), "released");
            pack();
              if( width < getWidth())                    // prevent setting width too small
                 width = getWidth();
              if(height < getHeight())               // prevent setting height too small
                   height = getHeight();
              centerOnScreen(width, height);
           public void centerOnScreen(int width, int height)
             int top, left, x, y;
             // Get the screen dimension
             Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
             // Determine the location for the top left corner of the frame
             x = (screenSize.width - width)/2;
             y = (screenSize.height - height)/2;
             left = (x < 0) ? 0 : x;
             top = (y < 0) ? 0 : y;
             // Set the frame to the specified location & size
           this.setBounds(left, top, width, height);
         private boolean validUser(String userID,String password)
                        throws PasswordException,SQLException,IOException,ClassNotFoundException
              boolean userOK = false;
              user = db.getUser(userID); // get user object from DB for this ID
              if(user != null)
                   user.validate(password); // throws PasswordException
                   userOK = true;
                   if(user.pswdAutoExpires())     // if tracking uses
                        db.updUser(user);          // update DB for this use
             return userOK;
        private void doStockActivity()throws PasswordException,SQLException,
                                                      IOException,ClassNotFoundException
            StockTracker f = new StockTracker(user,this,db);
            f.pack();
            this.setVisible(false);
            f.setVisible(true);
        public void activate()
            this.setVisible(true);
            userIDField.setText("");
            userIDField.requestFocus();
            user = null;
        public void actionPerformed(ActionEvent e)
              try
                   userID = userIDField.getText();
                if(userID.equals(""))
                           JOptionPane.showMessageDialog(this,
                            "Please enter a valid user ID.",
                           "Missing User ID.",
                           JOptionPane.ERROR_MESSAGE);
                       userIDField.requestFocus();
                   else
                        password = new String(passwordField.getPassword());
                     if(password.equals(""))
                                JOptionPane.showMessageDialog(this,
                                 "Please enter a valid password.",
                                "Missing Password.",
                                JOptionPane.ERROR_MESSAGE);
                            passwordField.requestFocus();
                        else
                             try
                                  // See if userID exists and validate password
                                  if(validUser(userID,password))
                                   if(user.pswdIsExpiring())
                                              JOptionPane.showMessageDialog(this,
                                                             user.getUserID()+" logon successful; "
                                                +user.getPswdUses()+" use(s) remaining.");
                                    if(e.getSource() == jbtLogon)
                                               doStockActivity();
                               else
                                    JOptionPane.showMessageDialog(this, "Invalid user.");
                             catch (PasswordExpiredException ex)
                                  JPasswordField pf1 = new JPasswordField();
                                  JPasswordField pf2 = new JPasswordField();
                                  Object[] message1 = new Object[]
                                            {"Password has expired. Please enter a new password.", pf1};
                                  Object[] options = new String[] {"OK", "Cancel"};
                                  JOptionPane op1 = new JOptionPane(message1,
                                                                     JOptionPane.WARNING_MESSAGE,
                                                              JOptionPane.OK_CANCEL_OPTION, null, options);
                                  JDialog dialog1 = op1.createDialog(null, "Change Password");
                                  dialog1.show();
                                  if(op1.getValue() != null && options[0].equals(op1.getValue()))
                                       String pswd1 = new String(pf1.getPassword());
                                       if(pswd1 != null)
                                           Object[] message2 = new Object[]
                                                               {"Please verify new password.", pf2};
                                            JOptionPane op2 = new JOptionPane(message2,
                                                                               JOptionPane.WARNING_MESSAGE,
                                                                       JOptionPane.OK_CANCEL_OPTION,
                                                                       null, options);
                                            JDialog dialog2 = op2.createDialog(null, "Verify Password");
                                            dialog2.show();
                                            if(op2.getValue() != null && options[0].equals(op2.getValue()))
                                                 String pswd2 = new String(pf2.getPassword());
                                                 if(pswd2 != null)
                                                      if(pswd1.equals(pswd2))
                                                        user.changePassword(password, pswd1);
                                                           db.updUser(user);
                                                           doStockActivity();
                                                      else
                                                           JOptionPane.showMessageDialog(this,
                                                          "Both passwords are not identical.",
                                                         "Password not changed",
                                                         JOptionPane.ERROR_MESSAGE);
                 userIDField.setText("");
                passwordField.setText("");
                userIDField.requestFocus();
            }// end of try
            catch (PasswordUsedException ex)
                JOptionPane.showMessageDialog(this,
                    ex.getMessage(),
                    "Password Previously Used. Try again.",
                    JOptionPane.ERROR_MESSAGE);
            catch (PasswordSizeException ex)
                JOptionPane.showMessageDialog(this,
                    ex.getMessage(),
                    "Invalid password size. Try again.",
                    JOptionPane.ERROR_MESSAGE);
            catch (PasswordInvalidFormatException ex)
                if(ex.getCount() > 2) // allows only 3 tries, then exits program
                     System.exit(0);
                else
                     JOptionPane.showMessageDialog(this,ex.getMessage()+", count:"+ex.getCount(),
                                                        "Invalid password format. Try again.",
                                                              JOptionPane.ERROR_MESSAGE);
            catch (PasswordInvalidException ex)
                if(ex.getCount() > 2) // allows only 3 tries, then exits program
                     System.exit(0);
                else
                     JOptionPane.showMessageDialog(this,ex.getMessage()+", count:"+ex.getCount(),
                                                        "Invalid password. Try again.",
                                                              JOptionPane.ERROR_MESSAGE);
            catch (PasswordException ex)
                JOptionPane.showMessageDialog(this,
                    ex.getMessage(),
                    "PasswordException.",
                    JOptionPane.ERROR_MESSAGE);
            catch (IOException ex)
                JOptionPane.showMessageDialog(this,
                    ex.getMessage(),
                    "IOException.",
                    JOptionPane.ERROR_MESSAGE);
            catch (SQLException ex)
                JOptionPane.showMessageDialog(this,
                    ex.getMessage(),
                    "SQLException.",
                    JOptionPane.ERROR_MESSAGE);
            catch (ClassNotFoundException ex)
                JOptionPane.showMessageDialog(this,
                    ex.getMessage(),
                    "ClassNotFoundException.",
                    JOptionPane.ERROR_MESSAGE);
        public static void main(String[] argv)
              final STLogon f = new STLogon();
              f.setVisible(true);
    //StudentDB.java
    import java.io.*;
    import java.sql.*;
    import java.util.*;
    public class StudentDB
         private Connection con = null;
         // Constructor; makes database connection
        public StudentDB() throws ClassNotFoundException,SQLException
              if(con == null)
                   String url = "jdbc:odbc:saad";
                 try
                      Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
                   catch(ClassNotFoundException ex)
                        throw new ClassNotFoundException(ex.getMessage() +
                                  "\nCannot locate sun.jdbc.odbc.JdbcOdbcDriver");
                 try
                        con = DriverManager.getConnection(url);
                   catch(SQLException ex)
                        throw new SQLException(ex.getMessage()+
                                  "\nCannot open database connection for "+url);
         // Close makes database connection; null reference to connection
         public void close() throws SQLException,IOException,ClassNotFoundException
              con.close();
               con = null;
         // Method to serialize object to byte array
        private byte[] serializeObj(Object obj) throws IOException
              ByteArrayOutputStream baOStream = new ByteArrayOutputStream();
            ObjectOutputStream objOStream = new ObjectOutputStream(baOStream);
            objOStream.writeObject(obj); // object must be Serializable
            objOStream.flush();
            objOStream.close();
            return baOStream.toByteArray(); // returns stream as byte array
         // Method to deserialize bytes from a byte array into an object
        private Object deserializeObj(byte[] buf)
                             throws IOException, ClassNotFoundException
             Object obj = null;
            if (buf != null)
                   ObjectInputStream objIStream =
                      new ObjectInputStream(new ByteArrayInputStream(buf));
                obj = objIStream.readObject(); //IOException, ClassNotFoundException
            return obj;
         // Methods for adding a record to a table
        // add to the Student Table
         public void addStudent(String IDNumber, String FirstName, String LastName)
                     throws SQLException, IOException, ClassNotFoundException
              Statement stmt = con.createStatement();
               stmt.executeUpdate("INSERT INTO Student VALUES ('"
                                 +IDNumber+"'"+",'"+FirstName+"'"+",'"+LastName+"')");
               stmt.close();
         // add to the Users table
         public boolean addUser(User user) throws SQLException,IOException,
                                                  ClassNotFoundException
           boolean result = false;
          String dbUserID;
          String dbLastName;
          String dbFirstName;
          Password dbPswd;
          String dbemail;
          boolean isAdmin;
          dbUserID = user.getUserID();
          if(getUser(dbUserID) == null)
                dbLastName = user.getFirstName();
                dbFirstName = user.getLastName();
              Password pswd = user.getPassword();
    //          dbemail = user.getEmail();
                isAdmin = user.isAdmin();
              PreparedStatement pStmt = con.prepareStatement(
                  "INSERT INTO Users VALUES (?,?,?,?,?,?)");
              pStmt.setString(1, dbUserID);
              pStmt.setString(2, dbFirstName);
              pStmt.setString(3, dbLastName);
              pStmt.setBytes(4, serializeObj(pswd));
    //          pStmt.setString(5, dbemail);
              pStmt.setBoolean(5, isAdmin);
              pStmt.executeUpdate();
              pStmt.close();
              result = true;
           else
                throw new IOException("User exists - cannot add.");
           return result;
         // add to the UserStocks table
         public void addStudentUserBridge(String userID, String IDNumber)
                     throws SQLException,IOException,ClassNotFoundException
              Statement stmt = con.createStatement();
               stmt.executeUpdate("INSERT INTO StudentUserBridge VALUES ('"
                                 +userID+"'"
                                 +",'"+IDNumber+"')");
               stmt.close();
         // Methods for updating a record in a table
        // updating the Users Table
         public boolean updUser(User user) throws SQLException,IOException,
                                                  ClassNotFoundException
           boolean result = false;
             String dbUserID;
          String dbLastName;
          String dbFirstName;
          Password dbPswd;
          String dbemail;
          boolean isAdmin;
          dbUserID = user.getUserID();
          if(getUser(dbUserID) != null)
                dbLastName = user.getFirstName();
                dbFirstName = user.getLastName();
              Password pswd = user.getPassword();
    //          dbemail = user.getEmail();
                isAdmin = user.isAdmin();
              PreparedStatement pStmt = con.prepareStatement("UPDATE Users SET FirstName = ?,"
                                           +" LastName = ?, pswd = ?, email = ?, admin = ? WHERE userID = ?");
              pStmt.setString(1, dbFirstName);
              pStmt.setString(2, dbLastName);
              pStmt.setBytes(3, serializeObj(pswd));
    //          pStmt.setString(4, dbemail);
              pStmt.setBoolean(4, isAdmin);
              pStmt.setString(5, dbUserID);
              pStmt.executeUpdate();
              pStmt.close();
              result = true;
           else
                throw new IOException("User does not exist - cannot update.");
           return result;
         // Methods for deleting a record from a table
        // delete a record from the Student Table
         private void delStudent(String IDNumber)
                      throws SQLException,IOException,ClassNotFoundException
              Statement stmt = con.createStatement();
               stmt.executeUpdate("DELETE FROM Student WHERE "
                                 +"IDNumber = '"+IDNumber+"'");
            stmt.close();
        // delete a record from the Users Table
         public void delUser(User user) throws SQLException,IOException,
                                                  ClassNotFoundException
               String dbUserID;
            String stockSymbol;
              Statement stmt = con.createStatement();
              try {
                   con.setAutoCommit(false);
                   dbUserID = user.getUserID();
                   if(getUser(dbUserID) != null)  // verify user exists in database
                         ResultSet rs1 = stmt.executeQuery("SELECT userID, IDNumber "
                                           +"FROM StudentUserBridge WHERE userID = '"+dbUserID+"'");
                         while(rs1.next())
                         try
                             stockSymbol = rs1.getString("IDNumber");
                                  delUserStocks(dbUserID, stockSymbol);
                            catch(SQLException ex)
                                  throw new SQLException("Deletion of user student failed: "
                                                        +ex.getMessage());
                          } // end of loop thru UserStocks
                    try
                    {  // holdings deleted, now delete user
                             stmt.executeUpdate("DELETE FROM Users WHERE "
                                           +"userID = '"+dbUserID+"'");
                       catch(SQLException ex)
                             throw new SQLException("User deletion failed: "+ex.getMessage());
                     else
                          throw new IOException("User not found in database - cannot delete.");
                   try
                      con.commit();
                    catch(SQLException ex)
                        throw new SQLException("Transaction commit failed: "+ex.getMessage());
              catch (SQLException ex)
                   try
                        con.rollback();
                   catch (SQLException sqx)
                        throw new SQLException("Transaction failed then rollback failed: "
                                              +sqx.getMessage());
                   // Transaction failed, was rolled back
                   throw new SQLException("Transaction failed; was rolled back: "
                                         +ex.getMessage());
            stmt.close();
        // delete a record from the StudentUserBridge Table
         public void delUserStocks(String userID, String stockSymbol)
                     throws SQLException,IOException,ClassNotFoundException
              Statement stmt = con.createStatement();
             ResultSet rs;
               stmt.executeUpdate("DELETE FROM StudentUserBridge WHERE "
                                 +"userID = '"+userID+"'"
                                 +"AND IDNumber = '"+stockSymbol+"'");
               rs = stmt.executeQuery("SELECT IDNumber FROM StudentUserBridge "
                                     +"WHERE IDNumber = '"+stockSymbol+"'");
                 if(!rs.next()) // no users have this stock
    //               delStock(stockSymbol);
               stmt.close();
         // Methods for listing record data from a table
         // Ordered by:
         //           methods that obtain individual field(s),
         //           methods that obtain a complete record, and
         //           methods that obtain multiple records
         // Methods to access one or more individual fields
        // get a stock description from the Stocks Table
         public String getStockDesc(String stockSymbol)
                       throws SQLException, IOException, ClassNotFoundException
              Statement stmt = con.createStatement();
                String stockDesc = null;
               ResultSet rs = stmt.executeQuery("SELECT IDNumber, name FROM Student "
                                               +"WHERE IDNumber = '"+stockSymbol+"'");
               if(rs.next())
                   stockDesc = rs.getString("IDNumber");
               rs.close();
               stmt.close();
                return stockDesc;
         // Methods to access a complete record
        // get User data from the Users Table
         public User getUser(String UserID) throws SQLException, IOException,
                                                   ClassNotFoundException
           Statement stmt = con.createStatement();
             String dbUserID;
          String dbLastName;
          String dbFirstName;
          Password dbPswd;
          String dbemail;
          boolean isAdmin;
          byte[] buf = null;
          User user = null;
          ResultSet rs = stmt.executeQuery("SELECT * FROM Users WHERE userID = '"
                                          +UserID+"'");
          if(rs.next())
                dbUserID = rs.getString("userID");
                 dbFirstName = rs.getString("FirstName");
                 dbLastName = rs.getString("LastName");
                 dbemail = rs.getString("email");
            // Do NOT use with JDK 1.2.2 using JDBC-ODBC bridge as
            // SQL NULL data value is not handled correctly.
              buf = rs.getBytes("pswd");
                 dbPswd = (Password)deserializeObj(buf);
                 isAdmin = rs.getBoolean("admin");
                user = new User(dbUserID,dbFirstName,dbLastName,dbPswd,isAdmin);
          rs.close();
          stmt.close();
           return user; // User object created for userID
         // Methods to access a list of records
        // get list of selected fields for all records from the Users Table
         public ArrayList listUsers() throws SQLException,IOException,
                                             ClassNotFoundException
          ArrayList aList = new ArrayList();
           Statement stmt = con.createStatement();
          ResultSet rs = stmt.executeQuery("SELECT userID, FirstName, LastName, admin "
                                          +"FROM Users ORDER BY userID");
          while(rs.next())
                aList.add(rs.getString("userID"));
                  aList.add(rs.getString("FirstName"));
                  aList.add(rs.getString("LastName"));
                  aList.add(new Boolean(rs.getBoolean("admin")));
          rs.close();
          stmt.close();
          return aList;
        // get all fields in all records for a given user from the Userstocks Table
         public ArrayList listUserStocks(String userID) throws SQLException,IOException,
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             

    saaddani wrote:
    No information popped up in the console window before, during, or after the error was given. The program compiled and ran and therefore no error information was provided in the complier window either.
    If I am missing what you are asking then please provide instructions as to how to find this error information. You are posting the error message for the exception but not printing the stack trace.
    Far as I can tell you are printing more information with each exception (for example "Exception creating Users table") but you did not post what that was, that info would localize the problem.
    As a guess the problem is when you extract the fields via the query. You are using named values rather than indexes and you use "select *" rather than specifically naming the columns. Some databases (for example Oracle), require that using names must be in exactly the same order as the query returns them. You have no idea what that order is because you use "select *"
    Finally it would be a LOT easier if you wrote classes that did nothing but the database operations. NO GUI CODE. You then test that code to make sure it works. Once that code works then you write gui code which uses those classes. Besides making it easier to understand you are also more likely to get assistance since there is less code to look at.

  • Returning the file count of a folder--too slow

    I am using the following to return the file count of a folder as part of a larger script
    with timeout of 5000 seconds
    tell application "Finder"
    set origFolder to "Somefolder" as alias
    set thePivotfiles to (every file of origFolder whose name ends with ".jpg")
    return the count of thePivotfiles
    end tell
    end timeout
    This script is rather slow to return the count of thePivotfiles--there are about 15,000 image files in the folder.
    Is there a faster way for the script to do this?
    Thanks.
    Pedro

    try using a shell script, something like :
    do shell script "cd ~/SomeFolder; ls -a | wc -l"
    more info here: http://developer.apple.com/mac/library/technotes/tn2002/tn2065.html
    .... btw, this is the Final Cut Pro forum. :/

  • How to get the FILE COUNT from File directory

    Hello,
    i have to develop a scenario like, get  the file count from source file directory and validate whether the file count is 5 or not. if 5 files exist i need to process those 5 files to DB tables. if file count is not equal to 5 then i need to send a mail to customer that files are missed at source directory. (subject as files were missed at source directory and in content i need to display the file names exist at source file directory. So that missed file will be generated by the customer based on this mail).
    Could you please let me know how to get the count of files from source file directory. if it is possible only with UDF please provide the Java code
    Best Regards,
    SARAN

    Do these files have some fixed names?
    Can you try to use the option Advanced Selection For Source File to make XI  pick all 5 files in one shot?
    Check this blog on the same -
    /people/mickael.huchet/blog/2006/09/18/xipi-how-to-exclude-files-in-a-sender-file-adapter
    If this is not a option - BPM sounds the only possible way.
    Regards,
    Bhavesh

  • Reoccuring errors with volume file count, directory count, etc...

    I'll give a little back story...
    I purchased a new MacBook Pro 17" with OS X Lion (10.7.2) preinstalled back in January of this year (2012).  I migrated my user accounts from my old MacBook Pro 15" (2008) running OS X Snow Leopard.  Almost right away I started having issues of all sorts, including Admin accounts that wouldn't allow me admin priveledges, hidden user groups, apps that wouldn't run, multiple obscure error messages and a host of other issues.  After scouring forums like this one I used Disk Utility and not only discovered innumerable permission errors but also disk errors like these:
    Invalid volume file count
    (It should be 1656658 instead of 1656636)
    Invalid volume directory count
    (It should be 345764 instead of 345743)
    Invalid volume free block count
    (It should be 69344839 instead of 69355225)
    Volume header needs minor repair
    Disk Repair would correct the ACH/permission errors and above-noted disk corruption, but only temporarily.  After repairs I would reboot and be met with all of the same problems in the migrated accounts.  Over the following days I reinstalled OS X Lion at least three or four times, completely wiping the 750 GB hard drive before two of those reinstalls (even doing one-pass reformatting on one of those instances).  After reinstalling the OS, I would reinstall from TimeMachine and be met with all of the same problems again.
    I then brought my machine in to the Genius Bar where, after more than two-and-a-half hours they declared it to be an unknown issue that must be related to defective hardware and replaced my entire machine.  But wait - there's more!
    After getting home and moving my old accounts back over from TimeMachine all the same issues began reoccuring.  After at least two more OS reinstalls later I discovered that uninstalling Norton Internet Security seemed to fix some problems.  However, running Disk Utility still returned results like those listed above...
    Then there were the failed attempts at upgrading from 10.7.2 to 10.7.3 which  hung at the end the first two times and required complete OS reinstalls from the Recovery HD.  Several more headaches later I eventually I managed a sucessful upgrade.
    But still I find myself with a machine that stalls on boot-up at least once or twice a week, necessitating a power-off to interupt the process.  After each of these instances I run Disk Utility and get more of the same...
    Checking volume information.
    Invalid volume file count
    (It should be 1656658 instead of 1656636)
    Invalid volume directory count
    (It should be 345764 instead of 345743)
    Invalid volume free block count
    (It should be 69344839 instead of 69355225)
    Volume header needs minor repair
    The volume [...] was found corrupt and needs to be repaired.
    And now, this morning, after a month or two of all that... and after installing the Java Security Upgrade last night, I can't get into my accounts at all.  On first boot-up it hung for 20 minutes before I shut it down.  After running Disk Utility from Recovery Drive and repairing the drive I rebooted and got the log-in screen.  I clicked on my user icon, typed the correct password, was shown they white/grey screen for a few flickering seconds then was brought back to the log-in screen.  I rebooted to the Recovery Disk, ran Disk Utility, saw all the same errors again, repaired the disk, rebooted and got the same problems with logging in again.
    I've repeated this cycle five times today, as both a normal boot-up and in "Safe Mode" all with the same results.  I've repaired the disk using Disk Utility from Recovery Disk as well as accessing the disk in Target Mode, and always there are the same errors needing to be repaired.
    I don't buy that I'm dealing with a hardware issue.  My antivirus and security software are all up-to-date.  What the heck is going on?  Why do I keep having these disk problems?  Why can't I access my accounts anymore?  Why does it keep hanging during boot-up?  Why am I about to throw the machine out my bedroom window?

    WithoutID wrote:
    I don't buy that I'm dealing with a hardware issue.
    You have a software issue carried over from the previous computer likely caused by Norton and perhaps some other issues related to recent malware.
    Your going to need to copy your users data folders only to a external drive and disconnect everything,
    command r boot into Recovery,
    DU erase (with Zero) your Lion partition,
    install Lion fresh from Apple,
    setup with the same name (important),
    Software update,
    install all your programs from fresh sources,
    and return files from the external drive manually into their respective folders
    in that precise order.
    and for good performance for a long time, try not to go over 50% of the drive filled, but certainly not more that 75%
    Do not use migration or TimeMachine restores.
    This is known as a Fresh Install, where everything is brand spanking new and only vetted files are returned.
    It's a pain I know, the problem with too much automation, the crap seeps in and ruins everything.
    I don't migrate nothing, I like my machines to work perfectly.
    https://discussions.apple.com/docs/DOC-3046
    https://discussions.apple.com/community/notebooks/macbook_pro?view=documents

  • File Count using SPFile Object

    Hi,
    I am trying to get the file count using through SPFile within the selected dates of date time controls as below.
    But not able to get the count of the files in the folder as there is not count property in the SPFile object.
    Please share your ideas/thoughts on the same.
                                    foreach (SPFile file in oFolder.Files)
                                        if ((file.TimeCreated > dtFromDate.SelectedDate) &&( file.TimeCreated<dtToDate.SelectedDate))
                                            int filecount;                              
    Regards,Sudheer
    Thanks & Regards, Sudheer

    Hi ,
    as you have int filecount, increase the count whenever it satisfies the if condition as mentioned
    above.
    int filecount=0;         
    foreach (SPFile file in oFolder.Files)
        if ((file.TimeCreated > dtFromDate.SelectedDate) &&( file.TimeCreated<dtToDate.SelectedDate))
                               filecount++;           
    Thanks,
    Vivek
    Please vote or mark your question answered, if my reply helps you

  • Collect file count and add to CSV file.

    I have this script efficiently crafted by Jacques Rioux and I now what to do a little more with it.
    What it currently does is look on my desktop at a select number of Folders on my desktop. It then looks at the keyword information and then returns the results to a csv file.
    it looks for all the photographs; shot by Matthew. edited by Matthew etc.... with the date appended to the start and then the next time the script is run it adds the next data to the bottom of the last.
    The result looks like this
    19/12/2012,255,412,37,68
    27/12/2012,197,342,16,26
    From the fist line you can see on the 19th December 2012 I shot 255 images
    No what I would like it to do is:-
    a) Specifaically look in the folders of the desktop whose name begins with BH, BU, DA, DI, DO, FR, IN, NO, MA, TM, WA, PR, SE (These folders may or may not exist at the time, but are the only folders it should look at)
    b) also do a file count of the contents of the above individual folders and append it to the csv file. Again a folder may not exist. Where it doesn't exist the file count must = 0 so that it can then be added to the CSV file.
    This is how I hope the line to look like from the CSV file,
    19/12/2012,255,412,37,68, 5,3,20,25,60,101,25,0,85,5,40,0,0
    from the line above you can see that the folders NO, PR, and SE were all non existant and therefore a 0 was written in its place on the CSV file.
    Below is the working script that looks for the keywords.
    set spotlightqueryList to {"Shot by Matthew", "Editted by Matthew", "Shot by Shah", "Editted by Shah"}
    set thefolders to {"Desktop"}
    set thekind to "PSD"
    set csvFileName to "ProductivityLog.csv"
    set tHome to path to home folder as string
    set tc to count spotlightqueryList
    set theseCount to {}
    repeat tc times
              set end of theseCount to 0
    end repeat
    repeat with i in thefolders
              set thepath to my existsItem(tHome & i)
              if thepath is not "" then -- exists
                        repeat with j from 1 to tc
                                  set tQuery to item j of spotlightqueryList
                                  do shell script "mdfind -onlyin " & thepath & " " & tQuery & " " & thekind & " | wc -l" -- wc return the number of lines
                                  set item j of theseCount to (item j of theseCount) + (the result as integer) -- add the number of lines
                        end repeat
              end if
    end repeat
    set csvPath to "DCKGEN:Brands:Zoom:Online Photography:" & csvFileName
    set oTID to text item delimiters
    set text item delimiters to "," -- CSV delimiter
    set thisLine to (theseCount as text) -- convert list to text, each number is separated by comma
    set text item delimiters to oTID
    tell (current date) to set tDate to short date string
    set beginning of theseCount to tDate -- insert the date (first column)
    set csvPath to "DCKGEN:Brands:Zoom:Online Photography:" & csvFileName
    set oTID to text item delimiters
    set text item delimiters to "," -- CSV delimiter
    set thisLine to (theseCount as text) -- convert list to text, each number is separated by comma
    set text item delimiters to oTID
    --- append this line to CSV file
    do shell script "echo " & (quoted form of thisLine) & " >>" & quoted form of POSIX path of csvPath
    on existsItem(f)
              try
                        return quoted form of POSIX path of (f as alias) -- exists
              end try
              return "" -- else not exists
    end existsItem
    (* just a way to visually see it working
    set dialog to "Matt Shot: \"" & item 1 of theseCount & "\"" & return & return & "Matt Edit: \"" & item 2 of theseCount & "\"" & return & return & "Shah Shot: \"" & item 3 of theseCount & "\"" & return & return & "Shah Edit: \"" & item 4 of theseCount & "\"" & return & return
    display dialog dialog
    This is what I began to wrote but really have no idea how I would write it into the data into the CSV file and also I was struggling to get the non existant folder to = 0?
    tell application "Finder"
              set folderA to (get first folder of desktop whose name starts with "BH")
              set folderB to (get first folder of desktop whose name starts with "Bu")
              set folderC to (get first folder of desktop whose name starts with "Da")
              set folderD to (get first folder of desktop whose name starts with "DI")
              set folderE to (get first folder of desktop whose name starts with "Do")
              set folderF to (get first folder of desktop whose name starts with "Fr")
              set folderG to (get first folder of desktop whose name starts with "In")
              set folderH to (get first folder of desktop whose name starts with "Ma")
              if (exists (get first folder of desktop whose name starts with "No")) is true then
                        set folderI to (get first folder of desktop whose name starts with "No")
              else
                        set folderI to "0"
                        set folderJ to (get first folder of desktop whose name starts with "To")
                        set folderK to (get first folder of desktop whose name starts with "Wa")
                        if (exists (get first folder of desktop whose name starts with "SE")) is truethen
                                  set folderL to (get first folder of desktop whose name starts with"SE")
                        else
                                  set folderL to "0"
                                  if (exists (get first folder of desktop whose name starts with "PR"))is true then
                                            set folderM to (get first folder of desktop whose name starts with "PR")
                                  else
                                            set folderM to "0"
                                            set folderM to (get first folder of desktop whose name starts with "PR")
                                  end if
                        end if
              end if
              tell application "System Events"
                        set contentsA to (number of files in folderA)
                        set contentsB to (number of files in folderB)
                        set contentsC to (number of files in folderC)
                        set contentsD to (number of files in folderD)
                        set contentsE to (number of files in folderE)
                        set contentsF to (number of files in folderF)
                        set contentsG to (number of files in folderG)
                        set contentsH to (number of files in folderH)
                        set contentsI to (number of files in folderI)
                        set contentsJ to (number of files in folderJ)
                        set contentsK to (number of files in folderK)
                        set contentsL to (number of files in folderL)
                        set contentsM to (number of files in folderM)
              end tell
    end tell
    I hope someone can help me compile the remaining data.
    Many thanks
    Matt

    OK i've done my homework and I have been able to get a lot closer I just need to make the search specific to a number of folders on the desktop?
    Line 7 explains how I would like it to search.
    set spotlightqueryList to {"Shot_by_Matthew", "Editted_by_Matthew", "Shot_by_Shah", "Editted_by_Shah"}
    set spotlightqueryList2 to {"AL70", "BH70", "BH70", "BU40", "ES20", "DV25", "DJ30", "RA30", "FR10", "GT55", "MA65", "MB65", "MC65", "FI65", "MF65", "MH65", "NN_", "TM15", "WA35", "PR_", "SE_"}
    set thefolders to {"Desktop"}
    --Here I need to limit the search so that it only looks in folders of the desktop whose name begins with "BH", "BU", "DA", "DI", "DO", "FR", "IN", "MA", "NO", "TM", "WA", "PR", "SE"
    set thekind to "PSD"
    set csvFileName to "ProductivityLog.csv"
    set tHome to path to home folder as string
    set tc to count spotlightqueryList
    set theseCount to {}
    repeat tc times
              set end of theseCount to 0
    end repeat
    set tc2 to count spotlightqueryList2
    set theseCount2 to {}
    repeat tc2 times
              set end of theseCount2 to 0
    end repeat
    repeat with i in thefolders
              set thepath to my existsItem(tHome & i)
              if thepath is not "" then -- exists
                        repeat with j from 1 to tc
                                  set tQuery to item j of spotlightqueryList
                                  do shell script "mdfind -onlyin " & thepath & " " & tQuery & " " & thekind & " | wc -l" -- wc return the number of lines
                                  set item j of theseCount to (item j of theseCount) + (the result as integer) -- add the number of lines
                        end repeat
              end if
    end repeat
    repeat with i2 in thefolders
              set thepath2 to my existsItem2(tHome & i2)
              if thepath2 is not "" then -- exists
                        repeat with j2 from 1 to tc2
                                  set tQuery2 to item j2 of spotlightqueryList2
                                  do shell script "mdfind -onlyin " & thepath2 & "  -name " & tQuery2 & " " & thekind & " | wc -l" -- wc return the number of lines
                                  set item j2 of theseCount2 to (item j2 of theseCount2) + (the result as integer) -- add the number of lines
                        end repeat
              end if
    end repeat
    set csvPath to "DCKGEN:Brands:Zoom:Online Photography:" & csvFileName
    set oTID to text item delimiters
    set text item delimiters to "," -- CSV delimiter
    set thisLine to (theseCount as text) -- convert list to text, each number is separated by comma
    set thisLine2 to (theseCount2 as text) -- convert list to text, each number is separated by comma
    set text item delimiters to oTID
    tell (current date) to set tDate to short date string
    set beginning of theseCount to tDate -- insert the date (first column)
    set csvPath to "DCKGEN:Brands:Zoom:Online Photography:" & csvFileName
    set oTID to text item delimiters
    set text item delimiters to "," -- CSV delimiter
    set thisLine to (theseCount as text) -- convert list to text, each number is separated by comma
    set thisLine2 to (theseCount2 as text) -- convert list to text, each number is separated by comma
    set text item delimiters to oTID
    --- append this line to CSV file
    do shell script "echo " & (quoted form of thisLine) & (quoted form of thisLine2) & " >>" & quoted form of POSIX path of csvPath
    on existsItem(f)
              try
                        return quoted form of POSIX path of (f as alias) -- exists
              end try
              return "" -- else not exists
    end existsItem
    on existsItem2(f)
              try
                        return quoted form of POSIX path of (f as alias) -- exists
              end try
              return "" -- else not exists
    end existsItem2
    (* just a way to visually see it working
    set dialog to "Matt Shot: \"" & item 1 of theseCount & "\"" & return & return & "Matt Edit: \"" & item 2 of theseCount & "\"" & return & return & "Shah Shot: \"" & item 3 of theseCount & "\"" & return & return & "Shah Edit: \"" & item 4 of theseCount & "\"" & return & return
    display dialog dialog

  • File count in PDF package

    Is there an easy way to get a count of the files in a packaged PDF? I know that I can extract all files to a folder and then get a file count from the folder, but I am hoping that there is an easy way in Acrobat to get this.

    The File operations in java.io are relative to the current directory--that is, whatever directory was current when the VM was started. They have nothing to do with where a given class resides.
    Use Class.getResource or Class.getResourceAsStream.

  • How to get file count in variable?

    dear all,
    how to get file count in variable?
    regards
    Naseer

    Hi Nazeer ,
    It wont take much time .. so simple :- )
    Create one os comand step
    ( for unix) Use
    wc -l filename.txt > someoutputfile.txt
    Now the number of lines in your file will be there in the output file ( someoutputfile.txt )
    Step2 :-
    Now use Cezar's logic to fetch the variable value ( file count ) from the output file .. ( select value for a variable from a file )
    This will not take eeven a second to finish the job.
    Regards,
    Rathish A M

  • [Microsoft][ODBC SQL Server Driver]COUNT field incorrect or syntax error

    Hi , i am trying to execute siple SP using JDBC-ODBC Bridge Driver
    Here my code :
    String dsn="Tritek1";
    String user="sa";
    String password="imcindia";
    Connection con1 = null;
    CallableStatement cstmt = null;
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver").newInstance();
    con1=DriverManager.getConnection("jdbc:odbc:"+dsn,user,password);
    Statement st=con1.createStatement();
    st.execute("use dm0102d");
    st.execute("setuser 'dm01012'");
    cstmt = conObject.connection(" ?=Call dms_ex_get_folder_info(?,?,?)");
    cstmt.setString(1,folderType);
    cstmt.registerOutParameter(2,java.sql.Types.VARCHAR);
    cstmt.registerOutParameter(3,java.sql.Types.VARCHAR);     bFlag=cstmt.execute();
    Here my SP :
         Procedure Name          :     dms_ex_get_folder_info
         Input Parameter(s)          :     a. folder_type char(20)
         Return Parameter(s)     :     a. Recordset consist edit_mask and folder_type_code from folder_reference table / error
         Procedure Type          :     select
         Programmer          :     Prashanth Kumar M.
         Creation Date          :     12/20/2005 (20th Dec, 2005)
         Tables Accessed          :     folder_reference
         Revised               :
              Programmer:     Date:     Description:
              Prashanth Kumar M.      12/21/2005 Modified the script as per the approved program specifications.
         Test Query:
              Declare @edit_mask char(15)
              Declare @folder_type_code char(2)
              execute dms_ex_get_folder_info 'Policy Folder',@edit_mask output,@folder_type_code output
              Print 'Edit Mask : ' + @edit_mask
              Print 'Folder Type Code : ' + @folder_type_code
    CREATE PROCEDURE dms_ex_get_folder_info
         @folder_type char(20),
         @edit_mask char(15) output,
         @folder_type_code char(2) output
    AS
         BEGIN
              -- Check if the record for @folder_type exists or not.
              BEGIN
                   -- return the record from folder_reference
                   SELECT
                        @edit_mask= IsNull(edit_mask,''),
                        @folder_type_code = IsNull(folder_type_code,'')
                   FROM      folder_reference
                   WHERE
                        folder_decode = ltrim(rtrim(@folder_type))
                   -- return the error message
                   IF @@error <> 0
                        BEGIN
                             RAISERROR 100016 'Error in gettting the record from folder_reference table'
                             RETURN (@@error)
                        END
                   IF @edit_mask = '' AND @folder_type_code = ''
                        BEGIN
                             RAISERROR 100017 'No matching details in the folder_reference table'
                        RETURN (@@error)
                        END
              END
         END
    GO
    Here My Exception:
    java.sql.SQLException: [Microsoft][ODBC SQL Server Driver]COUNT field incorrect or syntax error
         at sun.jdbc.odbc.JdbcOdbc.createSQLException(Unknown Source)
         at sun.jdbc.odbc.JdbcOdbc.standardError(Unknown Source)
         at sun.jdbc.odbc.JdbcOdbc.SQLExecute(Unknown Source)
         at sun.jdbc.odbc.JdbcOdbcPreparedStatement.execute(Unknown Source)
         at com.nyl.dms.bl.Folder.createFolder(Folder.java:121)
         at com.nyl.dms.bl.Folder.main(Folder.java:223)
    Any one can help me to overcome this problem . Thanks in advance.
    venkat

    Here's from one of those 10s of books.
    Quoted from JDBC 3.0 by Bernard Van Haecke:
    Stored procedures can return multiple result types because they can be composed of SQL statements that return diverse result types: resultsets and update counts (this includes special error codes).
    Now this doesn't sound very satisfactory. So I use Sybase since I don't have any other database at the moment, and write a simple stored procedure.
    CREATE proc testproc AS
    BEGIN
    -- My return code
    return 7
    END
    goThen a sample patchy buggy code to play around:
    import java.sql.*;
    public class ProcTesting {
        public static void main(String[] args) {
            String connUrl          = "jdbc:sybase:Tds:myserver:5150/dbinst";
            String userName         = "username";
            String password         = "password";
            Connection con          = null;
            CallableStatement stmt  = null;
            ResultSet rs            = null;
            String sql = "{? = call testproc}";
            try {
                Class.forName("com.sybase.jdbc2.jdbc.SybDriver").newInstance();
                con     = DriverManager.getConnection(connUrl, userName, password);
                stmt    = con.prepareCall(sql);
                stmt.registerOutParameter(1, Types.INTEGER);
                stmt.execute();
                System.out.println(stmt.getInt(1));
            } catch(Exception e) {
                e.printStackTrace();
            } finally {
                closeAll(con, stmt);
        public static void closeAll(Connection con, Statement stmt) {
            try {
                con.close();
            } catch(Exception e) {  }
            try {
                stmt.close();
            } catch(Exception e) {  }
    }Followed by:
    javac ProcTesting.java
    java -cp "%CLASSPATH%;C:\jarutils\jconn2.jar" ProcTesting
    Output:
    7
    Didn't you know this could be done?
    Happy new year, grandpa!

  • Different file count between Photo Elements 12 and Lightroom 5.

    To Whom it might concern:
    When I check properties the file count in Photo Elements 12 is different than that of Lightroom 5.
    In one case Photo Elements shows 743 files and 51 folders and lightroom shows 734 files.
    I counted each a every file and found Lightroom to have the correct count and Elements the same count
    but properties shows a count of 743.
    Please answer.
    Albert F Schwartz Jr
    E-mail - [email protected]

    If you think you have found a bug, you should report it to Adobe here: http://feedback.photoshop.com/
    This forum is not the place for bug reports

Maybe you are looking for

  • Safari crash- can anyone decipher this error report?

    This is the error report accompanying the crash that I had when i installed Safari and tried to open it. The browser never opened, just said an error had occurred. If anyone can decode this and let me know whats wrong Id love them! <?xml version="1.0

  • Photo gallery using SlidingPanel SpryData

    I want to build a horizontal photo gallery with Sliding Panels and getting the data from an xml file. SoI read carefully the example of Building a Sliding Panels widget with Spry Data but i cannot understand how to get 5 or 6 panels at once. My idea

  • Mac mini and h264 1080p stutter

    Hi, I tried to search on Internet but i didn't find a solution. If I try mov h264 1080p files (the one on the quick time site for example) the stutter terrible. The same but even worse with AVCHD files. It's this a limit of the mac mini or there some

  • Can an acer tablet be connected to the hp officejet 4620? and if yes how?

    I am trying to connect my Acer tablet to HP officejet all in one wireless printer. Any advice on how to do this.

  • Motherboard Changed - Can't use old Backups

    Hi! I'm pretty sure a similar problem has already been posted but the motherboard of my MacBook Pro had to be replaced (the old one was damaged) and now Time Machine is not using my old backups anymore and instead tries to create a new backup named D