Package com.datastax.driver.core

Examples of com.datastax.driver.core.PreparedStatement.bind()


            "SELECT schedule_id, time, type, value " +
            "FROM " + MetricsTable.AGGREGATE + " " +
            "WHERE schedule_id = ? AND bucket = ? " +
            "ORDER BY time, type";
        PreparedStatement statement = session.prepare(cql);
        BoundStatement boundStatement = statement.bind(scheduleId, bucket.toString());

        return new SimplePagedResult<AggregateNumericMetric>(boundStatement, new AggregateNumericMetricMapper(),
            storageSession);
    }
View Full Code Here


        for (int i = 0; i < propertyNames.length; ++i) {
          values[i] = insertBean.get(propertyNames[i]);
        }
        BoundStatement boundStatement = null;
        synchronized (_insertStatement) {
          boundStatement = _insertStatement.bind(values);
        }
        synchronized (_session) {
          _session.execute(boundStatement);
        }
      }
View Full Code Here

            }
          }
          values.add(primaryKeyValue);
          BoundStatement boundStatement = null;
          synchronized (_updateStatement) {
            boundStatement = _updateStatement
                .bind(values.toArray());
          }
          synchronized (_session) {
            _session.execute(boundStatement);
          }
View Full Code Here

        session.execute(createTableStatement);
        PreparedStatement prepared = session.prepare("INSERT INTO " + KEYSPACE + ".qp_cleanup (id, cid, val) VALUES (?, ?, ?)");
        session.execute(dropTableStatement);
        session.execute(createTableStatement);
        session.execute(prepared.bind(1, 1, "value"));

        session.execute(dropKsStatement);
        session.execute(createKsStatement);
        session.execute(createTableStatement);
        session.execute(prepared.bind(1, 1, "value"));
View Full Code Here

        session.execute(prepared.bind(1, 1, "value"));

        session.execute(dropKsStatement);
        session.execute(createKsStatement);
        session.execute(createTableStatement);
        session.execute(prepared.bind(1, 1, "value"));
        session.execute(dropKsStatement);

        // FIXME: where is invalidation actually tested?
  }
View Full Code Here

        PreparedStatement preparedInsert = session.prepare(insertCQL);
        PreparedStatement preparedSelect = session.prepare(selectCQL);

        session.execute(preparedInsert.bind(1, 1, "value"));
        assertEquals(1, session.execute(preparedSelect.bind(1)).all().size());

        cluster.close();

        cluster = Cluster.builder().addContactPoint("127.0.0.1")
                                   .withPort(DatabaseDescriptor.getNativeTransportPort())
View Full Code Here

        preparedInsert = session.prepare(insertCQL);
        preparedSelect = session.prepare(selectCQL);
        session.execute(preparedInsert.bind(1, 1, "value"));

        assertEquals(1, session.execute(preparedSelect.bind(1)).all().size());
    }
}
View Full Code Here

   * @param query The query to execute.
   * @return The results of executing the query.
   */
  public ResultSet execute(String query) {
    PreparedStatement preparedStatement = mStatementCache.getPreparedStatement(query);
    return mSession.execute(preparedStatement.bind());
  }

  /**
   * Asynchronously execute a statement, using a prepared statement if one already exists for the
   * statement, and creating and caching a prepared statement otherwise.
View Full Code Here

   * @param query The query to execute.
   * @return The results of executing the query.
   */
  public ResultSetFuture executeAsync(String query) {
    PreparedStatement preparedStatement = mStatementCache.getPreparedStatement(query);
    return mSession.executeAsync(preparedStatement.bind());
  }

  /**
   * Get the prepared statement for a query.
   *
 
View Full Code Here

            tableName,
            new Date(timestamp),
            layoutByteBuffer,
            updateByteBuffer));
      } else {
        mAdmin.execute(insertLayoutStatement.bind(tableName, new Date(), layoutByteBuffer));
      }
    }
    // TODO: Some kind of flush?
  }
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.