Examples of beforeFirst()


Examples of java.sql.ResultSet.beforeFirst()

        }
        case Value.RESULT_SET: {
            int len = 1;
            try {
                ResultSet rs = ((ValueResultSet) v).getResultSet();
                rs.beforeFirst();
                ResultSetMetaData meta = rs.getMetaData();
                int columnCount = meta.getColumnCount();
                len += getVarIntLen(columnCount);
                for (int i = 0; i < columnCount; i++) {
                    len += getStringLen(meta.getColumnName(i + 1));
View Full Code Here

Examples of java.sql.ResultSet.beforeFirst()

                        Value val = DataType.readValue(null, rs, i + 1, t);
                        len += getValueLen(val, handler);
                    }
                }
                len++;
                rs.beforeFirst();
            } catch (SQLException e) {
                throw DbException.convert(e);
            }
            return len;
        }
View Full Code Here

Examples of java.sql.ResultSet.beforeFirst()

                        Value val = DataType.readValue(session, rs, i + 1, t);
                        writeValue(val);
                    }
                }
                writeBoolean(false);
                rs.beforeFirst();
            } catch (SQLException e) {
                throw DbException.convertToIOException(e);
            }
            break;
        }
View Full Code Here

Examples of java.sql.ResultSet.beforeFirst()

  public void save (Connection connection, PrintWriter out) {
    Statement statement = null;
    try {
      statement = connection.createStatement();
      ResultSet set = statement.executeQuery( "SELECT * FROM " + tableName);
      set.beforeFirst();
     
      Map<String, String> columns = this.getColumnData(set);

      int c = 0;
      out.println("VERSION:2");
View Full Code Here

Examples of java.sql.ResultSet.beforeFirst()

      this.tables = new ArrayList<EncryptedTable>();
     
      try {
        Statement statement = connection.createStatement();
        ResultSet set = statement.executeQuery("SHOW TABLE STATUS");
        set.beforeFirst();
       
        while (set.next()) {
          String engine = set.getString(2);
          if ("memory".equalsIgnoreCase(engine)) {
            this.tables.add(new EncryptedTable(this, set.getString(1)));
View Full Code Here

Examples of java.sql.ResultSet.beforeFirst()

            statement.setInt(1, sessionID);
            results = statement.executeQuery();
            results.last();
            headingsCount = results.getRow();
            headings = new String[headingsCount];
            results.beforeFirst();
            while (results.next()) {
                headings[results.getInt("position")] = results.getString("name");
            }
            results.close();
            statement.close();
View Full Code Here

Examples of java.sql.ResultSet.beforeFirst()

      rs = pstmt.executeQuery();

      if (rs.next()) {
        rs.last();
        returnTypeList = new ArrayList<ReturnType>(rs.getRow());
        rs.beforeFirst();

        while (rs.next()) {
          returnTypeList.add(beanPopulator.populate(rs));
        }
      }
View Full Code Here

Examples of java.sql.ResultSet.beforeFirst()

      // Send query to database and store results.
      rs = pstmt.executeQuery();

      if (rs.next()) {
        returnTypeMap = new HashMap<KeyType, ValueType>();
        rs.beforeFirst();

        while (rs.next()) {
          Entry<KeyType, ValueType> entry = beanPopulator.populate(rs);
          returnTypeMap.put(entry.getKey(), entry.getValue());
        }
View Full Code Here

Examples of java.sql.ResultSet.beforeFirst()

    return false;
  }
 
  public ArrayList query(Table obj, String query) throws Exception {
    ResultSet rs = this.executeSelect(query, obj);
    rs.beforeFirst();
    Class<?> c = obj.getClass();
    ArrayList list = new ArrayList();
    while(rs.next())  {
      Object newObj = c.newInstance();
      extendObject(rs, newObj);
View Full Code Here

Examples of java.sql.ResultSet.beforeFirst()

      query += " ORDER BY "+order;
    if (pageIndex >= 0 && pageSize > 0)
      query += " LIMIT "+pageIndex*pageSize+","+pageSize;
   
    ResultSet rs = this.executeSelect(query, obj);
    rs.beforeFirst();
    Class<?> c = obj.getClass();
    while(rs.next())  {
      Object newObj = c.newInstance();
      extendObject(rs, newObj);
      list.add(newObj);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.