Package com.bryghts.kissdata.bites

Examples of com.bryghts.kissdata.bites.DataBite


      {
        metadata = resultSet.getMetaData();
      }
      catch (SQLException e1)
      {
        throw new DataBite(e);
      }

      int columnCount = 0;
      try
      {
        columnCount = metadata.getColumnCount();
      }
      catch(SQLException e1)
      {
        throw new DataBite(e);
      }

      for(int i = 0; i < columnCount; i++)
      {
        String columnLabel = "";

        try
        {
          columnLabel = metadata.getColumnLabel(i);
        }
        catch(SQLException e1)
        {
          throw new DataBite(e);
        }

        if(columnLabel.equals(which))
          throw new DataBite(e);
      }

      throw new NoWordBite("The line has not the word '" + which + "'");
    }
  }
View Full Code Here


      {
        metadata = resultSet.getMetaData();
      }
      catch (SQLException e1)
      {
        throw new DataBite(e);
      }

      int columnCount = 0;
      try
      {
        columnCount = metadata.getColumnCount();
      }
      catch(SQLException e1)
      {
        throw new DataBite(e);
      }

      if(columnCount <= 0)
        throw new NoWordBite("The line has no words");

      throw new DataBite(e);
    }
  }
View Full Code Here

    try
    {
      connection = connectionPool.getConnection();

      if(connection == null)
        throw new DataBite("Could not get a Connection from the pool");

      stmt = connection.prepareStatement(petition);

      int i = 1;

      for (Object parameter : parameters)
      {
        stmt.setObject(i, parameter);
        i++;
      }

      stmt.executeUpdate();

      stmt.close();
      stmt = null;

      try
      {
        connection.close();
      }
      catch(SQLException e)
      {
        connection = null;
        throw e;
      }
    }
    catch (SQLException e)
    {
      if(stmt != null)
        try
          {stmt.close();}
        catch (SQLException e1)
        {
        }

      if(connection != null)
        try
          {connection.close();}
        catch (SQLException e1)
        {
        }

      throw new DataBite(e);
    }
  }
View Full Code Here

    try
    {
      connection = connectionPool.getConnection();

      if(connection == null)
        throw new DataBite("Could not get a Connection from the pool");

      stmt = connection.createStatement();

      stmt.executeUpdate(petition);

      stmt.close();
      stmt = null;

      try
      {
        connection.close();
      }
      catch(SQLException e)
      {
        connection = null;
        throw e;
      }
    }
    catch (SQLException e)
    {
      if(stmt != null)
        try
          {stmt.close();}
        catch (SQLException e1)
        {
        }

      if(connection != null)
        try
          {connection.close();}
        catch (SQLException e1)
        {
        }

      throw new DataBite(e);
    }
  }
View Full Code Here

    try
    {
      connection = connectionPool.getConnection();

      if(connection == null)
        throw new DataBite("Could not get a Connection from the pool");


      stmt = connection.prepareStatement(question);

      int i = 1;

      for (Object parameter : parameters)
      {
        stmt.setObject(i, parameter);
        i++;
      }

      ResultSet rs = stmt.executeQuery();
      JdbcLine line = new JdbcLine(rs);

      List<T> r = new ArrayList<T>();

      while(rs.next())
      {
        r.add(listener.listenLine(line));
      }

      stmt.close();
      stmt = null;

      try
      {
        connection.close();
      }
      catch(SQLException e)
      {
        connection = null;
        throw e;
      }

      return r;
    }
    catch (SQLException e)
    {
      if(stmt != null)
        try
          {stmt.close();}
        catch (SQLException e1)
        {
        }

      if(connection != null)
        try
          {connection.close();}
        catch (SQLException e1)
        {
        }

      throw new DataBite(e);
    }
  }
View Full Code Here

    try
    {
      connection = connectionPool.getConnection();

      if(connection == null)
        throw new DataBite("Could not get a Connection from the pool");

      stmt = connection.createStatement();

      ResultSet rs = stmt.executeQuery(question);
      JdbcLine line = new JdbcLine(rs);

      List<T> r = new ArrayList<T>();

      while(rs.next())
      {
        T tmp = listener.listenLine(line);
        if(tmp != null)
          r.add(tmp);
      }

      stmt.close();
      stmt = null;

      try
      {
        connection.close();
      }
      catch(SQLException e)
      {
        connection = null;
        throw e;
      }

      return r;
    }
    catch (SQLException e)
    {
      if(stmt != null)
        try
          {stmt.close();}
        catch (SQLException e1)
        {
        }

      if(connection != null)
        try
          {connection.close();}
        catch (SQLException e1)
        {
        }

      throw new DataBite(e);
    }
  }
View Full Code Here

TOP

Related Classes of com.bryghts.kissdata.bites.DataBite

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.