Examples of prepareStatement()


Examples of org.apache.olio.workload.loader.framework.ThreadConnection.prepareStatement()

    }
   
     public void load() {
        ThreadConnection c = ThreadConnection.getInstance();
        try {
            PreparedStatement s = c.prepareStatement(STATEMENT);
            for (int i = 0; i < fields.length; i++)
                if (fields[i] != null)
                    s.setString(i + 1, fields[i]);
                else
                    s.setNull(i + 1, Types.VARCHAR);
View Full Code Here

Examples of org.apache.openjpa.jdbc.sql.SQLBuffer.prepareStatement()

        Connection conn = store.getConnection();
        PreparedStatement stmnt = null;
        ResultSet rs = null;
        try {
            stmnt = sql.prepareStatement(conn,
                ResultSet.TYPE_SCROLL_INSENSITIVE,
                ResultSet.CONCUR_UPDATABLE);
            rs = stmnt.executeQuery();
            rs.next();
View Full Code Here

Examples of org.apache.phoenix.jdbc.PhoenixConnection.prepareStatement()

        mutations.add(put);
        hTable.batch(mutations);
   
        // Demonstrates weakness of HBase Bytes serialization. Negative numbers
        // show up as bigger than positive numbers
        PreparedStatement statement = conn.prepareStatement(query);
        ResultSet rs = statement.executeQuery();
        assertTrue(rs.next());
        assertEquals("e", rs.getString(1));
        assertFalse(rs.next());
    }
View Full Code Here

Examples of org.conserve.connection.ConnectionWrapper.prepareStatement()

    PersistenceManager persist = new PersistenceManager(driver, database,
        login, password);
    ConnectionWrapper cw = persist.getConnectionWrapper();
   
    PreparedStatement stmt = cw.prepareStatement("SELECT COUNT(*) FROM C__ARRAY");
    ResultSet rs = stmt.executeQuery();
    if(rs.next())
    {
      System.out.println("Found " + rs.getInt(1) + " objects.");
    }
View Full Code Here

Examples of org.exoplatform.services.jcr.impl.checker.InspectionQuery.prepareStatement()

      Connection jdbcConnection = openConnection();
      try
      {
         InspectionQuery query = getSelectQuery();

         preparedStatement = query.prepareStatement(jdbcConnection);
         resultSet = preparedStatement.executeQuery();

         while (resultSet.next())
         {
            String idColumn = query.getFieldNames()[0];
View Full Code Here

Examples of org.jboss.soa.esb.helpers.persist.JdbcCleanConn.prepareStatement()

    JdbcCleanConn oConn = null;
    PreparedStatement ps = null;
    try
    {
      oConn = createJdbcCleanConnection();
      ps = oConn.prepareStatement(getInsertStmt());
      oConn.execUpdWait(ps, 3); // TODO the executeUpdate routine doesn't check return code, which could mask a problem https://jira.jboss.org/jira/browse/SOA-642                 
      // TODO the executeUpdate routine doesn't check return code, which could mask a problem https://jira.jboss.org/jira/browse/SOA-642
      oConn.commit();
    }
    catch( SQLException e)
View Full Code Here

Examples of org.mule.module.db.internal.domain.connection.DbConnection.prepareStatement()

            }

            PreparedStatement preparedStatement;
            try
            {
                preparedStatement = connection.prepareStatement(query.getQueryTemplate().getSqlText());
            }
            catch (SQLException e)
            {
                return new DefaultResult<MetaData>(null, Result.Status.FAILURE, e.getMessage(), FailureType.INVALID_CONFIGURATION, e);
            }
View Full Code Here

Examples of org.ofbiz.entity.jdbc.SQLProcessor.prepareStatement()

        sqlBuffer.append(SqlJdbcUtil.makeWhereClause(modelEntity, modelEntity.getPkFieldsUnmodifiable(), entity, "AND", datasourceInfo.joinStyle));

        SQLProcessor sqlP = new SQLProcessor(helperInfo);

        try {
            sqlP.prepareStatement(sqlBuffer.toString(), true, ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY);
            SqlJdbcUtil.setPkValues(sqlP, modelEntity, entity, modelFieldTypeReader);
            sqlP.executeQuery();

            if (sqlP.next()) {
                for (int j = 0; j < partialFields.size(); j++) {
View Full Code Here

Examples of org.opensolaris.opengrok.jdbc.ConnectionResource.prepareStatement()

    private void clearHistoryForRepository(Repository repository)
            throws SQLException {
        final ConnectionResource conn =
                connectionManager.getConnectionResource();
        try {
            try (PreparedStatement ps = conn.prepareStatement(
                         getQuery("clearRepository"))) {
                ps.setInt(1, getRepositoryId(conn, repository));
                ps.execute();
                conn.commit();
            }
View Full Code Here

Examples of se.rupy.pool.Connection.prepareStatement()

      if(Sprout.SQL.driver().equals("org.postgresql.Driver") ||
          Sprout.SQL.driver().equals("oracle.jdbc.OracleDriver")) {
        sql = "SELECT count(*) AS count FROM poll_table WHERE poll_type = " + type;
      }
     
      stmt = conn.prepareStatement(sql);
      result = stmt.executeQuery();
      if(result.next()) {
        return result.getLong("count");
      }
    } catch(SQLException e) {
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.