Package com.impossibl.postgres.protocol

Examples of com.impossibl.postgres.protocol.PrepareCommand


        cursorName = name = null;
      }

    }

    PrepareCommand prep = connection.getProtocol().createPrepare(name, sqlText.toString(), Collections.<Type> emptyList());

    SQLWarning warningChain = connection.execute(prep, true);

    resultFields = prep.getDescribedResultFields();

    return warningChain;
  }
View Full Code Here


          @Override
          public CachedStatement call() throws Exception {

            String name = CACHED_STATEMENT_PREFIX + Integer.toString(key.hashCode());

            PrepareCommand prep = connection.getProtocol().createPrepare(name, sqlText, Collections.<Type> emptyList());

            warningChain = connection.execute(prep, true);

            return new CachedStatement(name, prep.getDescribedParameterTypes(), prep.getDescribedResultFields());
          }

        });

      }
View Full Code Here

        List<Type> parameterTypes = mergeTypes(batchParameterTypes.get(c), lastParameterTypes);

        if (lastParameterTypes == null || !lastParameterTypes.equals(parameterTypes)) {

          PrepareCommand prep = connection.getProtocol().createPrepare(null, sqlText, parameterTypes);

          connection.execute(prep, true);

          parameterTypes = prep.getDescribedParameterTypes();
          lastParameterTypes = parameterTypes;
          lastResultFields = prep.getDescribedResultFields();
        }

        List<Object> parameterValues = batchParameterValues.get(c);

        command.setParameterTypes(parameterTypes);
View Full Code Here

    return prepareUtilQuery(name, sql, parameterTypes);
  }

  public PreparedQuery prepareUtilQuery(String name, String sql, List<Type> parameterTypes) throws IOException {

    PrepareCommand prep = protocol.createPrepare(name, sql, parameterTypes);
    protocol.execute(prep);

    if (prep.getError() != null) {
      throw new IOException("unable to prepare query: " + prep.getError().getMessage());
    }

    PreparedQuery pq = new PreparedQuery(name, prep.getDescribedParameterTypes(), prep.getDescribedResultFields());
    utilQueries.put(name, pq);
    return pq;
  }
View Full Code Here

        throw new IOException("invalid utility query");
      }
      return util;
    }

    PrepareCommand prepare = protocol.createPrepare(null, queryTxt, Collections.<Type> emptyList());

    protocol.execute(prepare);

    if (prepare.getError() != null) {
      throw new NoticeException("Error preparing query", prepare.getError());
    }

    return new PreparedQuery(null, prepare.getDescribedParameterTypes(), prepare.getDescribedResultFields());
  }
View Full Code Here

TOP

Related Classes of com.impossibl.postgres.protocol.PrepareCommand

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.