org.postgresql.core
Class NativeQuery

java.lang.Object
  extended by org.postgresql.core.NativeQuery

public class NativeQuery
extends Object

Represents a query that is ready for execution by backend. The main difference from JDBC is ? are replaced with $1, $2, etc.


Field Summary
 int[] bindPositions
           
 String nativeSql
           
 
Constructor Summary
NativeQuery(String nativeSql)
           
NativeQuery(String nativeSql, int[] bindPositions)
           
 
Method Summary
static String bindName(int index)
          Returns $1, $2, etc names of bind variables used by backend.
 String toString(ParameterList parameters)
          Stringize this query to a human-readable form, substituting particular parameter values for parameter placeholders.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

nativeSql

public final String nativeSql

bindPositions

public final int[] bindPositions
Constructor Detail

NativeQuery

public NativeQuery(String nativeSql)

NativeQuery

public NativeQuery(String nativeSql,
                   int[] bindPositions)
Method Detail

toString

public String toString(ParameterList parameters)
Stringize this query to a human-readable form, substituting particular parameter values for parameter placeholders.

Parameters:
parameters - a ParameterList returned by this Query's Query.createParameterList() method, or null to leave the parameter placeholders unsubstituted.
Returns:
a human-readable representation of this query

bindName

public static String bindName(int index)
Returns $1, $2, etc names of bind variables used by backend.

Parameters:
index - index of a bind variable
Returns:
bind variable name


Copyright © 2016 PostgreSQL Global Development Group. All rights reserved.