Package java.io

Examples of java.io.IOException


          else if ("tvbrowser".equals(type)) {
            curItem=new TvbrowserSoftwareUpdateItem(className);
          }

          if (curItem==null) {
            throw new IOException("invalid software update file");
          }

          updateItems.add(curItem);
        }
        else {
View Full Code Here


      */
      // conn = DriverManager.getConnection(connurl, props); // MySQL (the database must exist and start seperately)
      conn = getConnection();
      conn.setAutoCommit(false);
    } catch (IllegalAccessException exc) {
      throw new IOException(exc.getMessage());
    } catch (ClassNotFoundException exc) {
      throw new IOException(exc.getMessage());
    } catch (InstantiationException exc) {
      throw new IOException(exc.getMessage());
    } catch (SQLException sqle) {
      throw new IOException(sqle.getMessage());
    }

    try {
      // Creating a statement lets us issue commands against the connection.
      Statement s = conn.createStatement();
      // We create the table.
//         s.execute("create cached table JoramDB(name VARCHAR PRIMARY KEY, content VARBINARY(256))");
      /*
      s.execute("CREATE TABLE JoramDB (name VARCHAR(256), content LONG VARCHAR FOR BIT DATA, PRIMARY KEY(name))");
      */
      s.execute("CREATE TABLE JoramDB (name VARCHAR(256), content longblob, primary key(name))"); // MySQL
      s.close();
      conn.commit();
    } catch (SQLException sqle) {
        String exceptionString = sqle.toString();
        if (exceptionString.indexOf("CREATE command denied") == -1)
        {
            sqle.printStackTrace();
        }
    } catch (Exception e) {
        e.printStackTrace();
    }

    try {
      insertStmt = conn.prepareStatement("INSERT INTO JoramDB VALUES (?, ?)");
      updateStmt = conn.prepareStatement("UPDATE JoramDB SET content=? WHERE name=?");
      deleteStmt = conn.prepareStatement("DELETE FROM JoramDB WHERE name=?");
    } catch (SQLException sqle) {
      sqle.printStackTrace();
      throw new IOException(sqle.getMessage());
    } catch (Exception e) {
      e.printStackTrace();
      // throw e;
    }
  }
View Full Code Here

      if (reconnectLoop)
          logger.log(BasicLevel.WARN, "Database reconnection problem at list");

      logger.log(BasicLevel.WARN, "list, problem list " + prefix);
      sqle.printStackTrace();
      throw new IOException(sqle.getMessage());
    } catch (Exception e) {
        logger.log(BasicLevel.WARN, "list, problem list " + prefix + " in e with " + e.getMessage());
        e.printStackTrace();
        throw new IOException(e.getMessage());
    }
  }
View Full Code Here

      String exceptionString = e.toString();
      if (exceptionString.indexOf("KNOWN PROBLEM") == -1)
      {
          e.printStackTrace();
      }
      throw new IOException(e.getMessage());
    } finally {
      ois.close();
      bis.close();
    }
  }
View Full Code Here

      if (reconnectLoop)
          logger.log(BasicLevel.WARN, "Database reconnection problem at load");

      logger.log(BasicLevel.WARN, "load, problem load " + name);
      sqle.printStackTrace();
      throw new IOException(sqle.getMessage());
    } catch (Exception e) {
       String exceptionString = e.toString();
       if (exceptionString.indexOf("KNOWN PROBLEM") == -1)
       {
          logger.log(BasicLevel.WARN, "load, problem load " + name + " in e with " + e.getMessage());
View Full Code Here

          if (reconnectLoop)
              logger.log(BasicLevel.WARN, "Database reconnection problem at delete");

          logger.log(BasicLevel.WARN, "delete, problem delete " + name);
          sqle.printStackTrace();
          throw new IOException(sqle.getMessage());
      }
    } catch (Exception e) {
      logger.log(BasicLevel.WARN, "delete, problem delete " + name + " in e with " + e.getMessage());
      e.printStackTrace();
      // throw e;
View Full Code Here

  public void commit() throws IOException {
    try {
      conn.commit();
    } catch (SQLException sqle) {
      sqle.printStackTrace();
      throw new IOException(sqle.getMessage());
    } catch (Exception e) {
      e.printStackTrace();
      // throw e;
    }
  }
View Full Code Here

  public void close() throws IOException {
    try {
      conn.close();
    } catch (SQLException sqle) {
      sqle.printStackTrace();
      throw new IOException(sqle.getMessage());
    } catch (Exception e) {
      e.printStackTrace();
      // throw e;
    }
View Full Code Here

          insertStmt = conn.prepareStatement("INSERT INTO JoramDB VALUES (?, ?)");
          updateStmt = conn.prepareStatement("UPDATE JoramDB SET content=? WHERE name=?");
          deleteStmt = conn.prepareStatement("DELETE FROM JoramDB WHERE name=?");
      } catch (Exception sqle) {
          sqle.printStackTrace();
          throw new IOException(sqle.getMessage());
      }
      logger.log(BasicLevel.WARN, "Database reconnection success");
  }
View Full Code Here

    public void readExternal(ObjectInput in) throws IOException,
    ClassNotFoundException {
        try {
            parse(in.readUTF());
        } catch(MimeTypeParseException e) {
            throw new IOException(e.toString());
        }
    }
View Full Code Here

TOP

Related Classes of java.io.IOException

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.