Tabnine Logo
SimpleParameterList
Code IndexAdd Tabnine to your IDE (free)

How to use
SimpleParameterList
in
org.postgresql.core.v3

Best Java code snippets using org.postgresql.core.v3.SimpleParameterList (Showing top 20 results out of 315)

origin: postgresql/postgresql

public ParameterList createParameterList() {
  if (fragments.length == 1)
    return NO_PARAMETERS;
  return new SimpleParameterList(fragments.length - 1, protoConnection);
}
origin: org.postgresql/postgresql

public void setBinaryParameter(int index, byte[] value, int oid) throws SQLException {
 bind(index, value, oid, BINARY);
}
origin: org.postgresql/postgresql

public void checkAllParametersSet() throws SQLException {
 for (SimpleParameterList subparam : subparams) {
  subparam.checkAllParametersSet();
 }
}
origin: org.postgresql/postgresql

@Override
public void appendAll(ParameterList list) throws SQLException {
 if (list instanceof org.postgresql.core.v3.SimpleParameterList ) {
  /* only v3.SimpleParameterList is compatible with this type
  we need to create copies of our parameters, otherwise the values can be changed */
  SimpleParameterList spl = (SimpleParameterList) list;
  int inParamCount = spl.getInParameterCount();
  if ((pos + inParamCount) > paramValues.length) {
   throw new PSQLException(
    GT.tr("Added parameters index out of range: {0}, number of columns: {1}.",
      (pos + inParamCount), paramValues.length),
      PSQLState.INVALID_PARAMETER_VALUE);
  }
  System.arraycopy(spl.getValues(), 0, this.paramValues, pos, inParamCount);
  System.arraycopy(spl.getParamTypes(), 0, this.paramTypes, pos, inParamCount);
  System.arraycopy(spl.getFlags(), 0, this.flags, pos, inParamCount);
  System.arraycopy(spl.getEncoding(), 0, this.encoded, pos, inParamCount);
  pos += inParamCount;
 }
}
origin: org.postgresql/postgresql

private void sendFastpathCall(int fnid, SimpleParameterList params)
  throws SQLException, IOException {
 if (LOGGER.isLoggable(Level.FINEST)) {
  LOGGER.log(Level.FINEST, " FE=> FunctionCall({0}, {1} params)", new Object[]{fnid, params.getParameterCount()});
 int paramCount = params.getParameterCount();
 int encodedSize = 0;
 for (int i = 1; i <= paramCount; ++i) {
  if (params.isNull(i)) {
   encodedSize += 4;
  } else {
   encodedSize += 4 + params.getV3Length(i);
 pgStream.sendInteger2(paramCount);
 for (int i = 1; i <= paramCount; ++i) {
  pgStream.sendInteger2(params.isBinary(i) ? 1 : 0);
  if (params.isNull(i)) {
   pgStream.sendInteger4(-1);
  } else {
   pgStream.sendInteger4(params.getV3Length(i)); // Parameter size
   params.writeV3Value(i, pgStream);
origin: org.postgresql/postgresql

private void sendParse(SimpleQuery query, SimpleParameterList params, boolean oneShot)
  throws IOException {
 int[] typeOIDs = params.getTypeOIDs();
 if (query.isPreparedFor(typeOIDs, deallocateEpoch)) {
  return;
  sbuf.append(nativeSql);
  sbuf.append("\",oids={");
  for (int i = 1; i <= params.getParameterCount(); ++i) {
   if (i != 1) {
    sbuf.append(",");
   sbuf.append(params.getTypeOID(i));
   + (encodedStatementName == null ? 0 : encodedStatementName.length) + 1
   + queryUtf8.length + 1
   + 2 + 4 * params.getParameterCount();
 pgStream.sendInteger2(params.getParameterCount()); // # of parameter types specified
 for (int i = 1; i <= params.getParameterCount(); ++i) {
  pgStream.sendInteger4(params.getTypeOID(i));
origin: postgresql/postgresql

boolean paramsHasUnknown = params.hasUnresolvedTypes();
  int paramOIDs[] = params.getTypeOIDs();
  for (int i=0; i<paramOIDs.length; i++) {
      params.setResolvedType(i+1, queryOIDs[i]);
origin: org.postgresql/postgresql

params.setResolvedType(i, typeOid);
 || (origStatementName != null
   && origStatementName.equals(query.getStatementName()))) {
query.setPrepareTypes(params.getTypeOIDs());
origin: org.postgresql/postgresql

public int[] getTypeOIDs() {
 int[] oids = new int[total];
 for (int i = 0; i < offsets.length; i++) {
  int[] subOids = subparams[i].getTypeOIDs();
  System.arraycopy(subOids, 0, oids, offsets[i], subOids.length);
 }
 return oids;
}
origin: org.postgresql/postgresql

public void clear() {
 for (SimpleParameterList subparam : subparams) {
  subparam.clear();
 }
}
origin: org.postgresql/postgresql

public ParameterList copy() {
 SimpleParameterList[] copySub = new SimpleParameterList[subparams.length];
 for (int sub = 0; sub < subparams.length; ++sub) {
  copySub[sub] = (SimpleParameterList) subparams[sub].copy();
 }
 return new CompositeParameterList(copySub, offsets);
}
origin: org.postgresql/postgresql

CompositeParameterList(SimpleParameterList[] subparams, int[] offsets) {
 this.subparams = subparams;
 this.offsets = offsets;
 this.total = offsets[offsets.length - 1] + subparams[offsets.length - 1].getInParameterCount();
}
origin: org.postgresql/postgresql

public void convertFunctionOutParameters() {
 for (SimpleParameterList subparam : subparams) {
  subparam.convertFunctionOutParameters();
 }
}
origin: postgresql/postgresql

private void sendFastpathCall(int fnid, SimpleParameterList params) throws SQLException, IOException {
  if (logger.logDebug())
    logger.debug(" FE=> FunctionCall(" + fnid + ", " + params.getParameterCount() + " params)");
  int paramCount = params.getParameterCount();
  int encodedSize = 0;
  for (int i = 1; i <= paramCount; ++i)
    if (params.isNull(i))
      encodedSize += 4;
    else
      encodedSize += 4 + params.getV3Length(i);
  pgStream.SendInteger2(paramCount);
  for (int i = 1; i <= paramCount; ++i)
    pgStream.SendInteger2(params.isBinary(i) ? 1 : 0);
  pgStream.SendInteger2(paramCount);
  for (int i = 1; i <= paramCount; i++)
    if (params.isNull(i))
      pgStream.SendInteger4(params.getV3Length(i));   // Parameter size
      params.writeV3Value(i, pgStream);
origin: postgresql/postgresql

private void sendParse(SimpleQuery query, SimpleParameterList params, boolean oneShot) throws IOException {
  int[] typeOIDs = params.getTypeOIDs();
  if (query.isPreparedFor(typeOIDs))
    return;
    for (int i = 1; i <= params.getParameterCount(); ++i)
      sbuf.append("" + params.getTypeOID(i));
         + (encodedStatementName == null ? 0 : encodedStatementName.length) + 1
         + encodedSize + 1
         + 2 + 4 * params.getParameterCount();
  pgStream.SendInteger2(params.getParameterCount());       // # of parameter types specified
  for (int i = 1; i <= params.getParameterCount(); ++i)
    pgStream.SendInteger4(params.getTypeOID(i));
origin: org.postgresql/postgresql

boolean paramsHasUnknown = params.hasUnresolvedTypes();
 int[] paramOIDs = params.getTypeOIDs();
 for (int i = 0; i < paramOIDs.length; i++) {
   params.setResolvedType(i + 1, queryOIDs[i]);
origin: postgresql/postgresql

params.setResolvedType(i, typeOid);
query.setStatementTypes((int[])params.getTypeOIDs().clone());
origin: postgresql/postgresql

public int[] getTypeOIDs() {
  int oids[] = new int[total];
  for (int i=0; i<offsets.length; i++) {
    int subOids[] = subparams[i].getTypeOIDs();
    System.arraycopy(subOids, 0, oids, offsets[i], subOids.length);
  }
  return oids;
}
origin: postgresql/postgresql

public void clear() {
  for (int sub = 0; sub < subparams.length; ++sub)
  {
    subparams[sub].clear();
  }
}
origin: postgresql/postgresql

public ParameterList copy() {
  SimpleParameterList[] copySub = new SimpleParameterList[subparams.length];
  for (int sub = 0; sub < subparams.length; ++sub)
    copySub[sub] = (SimpleParameterList)subparams[sub].copy();
  return new CompositeParameterList(copySub, offsets);
}
org.postgresql.core.v3SimpleParameterList

Javadoc

Parameter list for a single-statement V3 query.

Most used methods

  • <init>
  • bind
  • checkAllParametersSet
  • clear
  • convertFunctionOutParameters
  • copy
  • getInParameterCount
  • getParameterCount
  • getTypeOID
  • getTypeOIDs
  • getV3Length
  • hasUnresolvedTypes
  • getV3Length,
  • hasUnresolvedTypes,
  • isBinary,
  • isNull,
  • setBytea,
  • setIntParameter,
  • setNull,
  • setResolvedType,
  • setStringParameter,
  • streamBytea

Popular in Java

  • Reading from database using SQL prepared statement
  • startActivity (Activity)
  • setScale (BigDecimal)
  • findViewById (Activity)
  • InputStream (java.io)
    A readable source of bytes.Most clients will use input streams that read data from the file system (
  • Proxy (java.net)
    This class represents proxy server settings. A created instance of Proxy stores a type and an addres
  • Path (java.nio.file)
  • Calendar (java.util)
    Calendar is an abstract base class for converting between a Date object and a set of integer fields
  • Random (java.util)
    This class provides methods that return pseudo-random values.It is dangerous to seed Random with the
  • Table (org.hibernate.mapping)
    A relational table
  • Top 17 PhpStorm Plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now