public interface PgqlPreparedStatement extends PgqlStatement, oracle.pgql.lang.PreparedStatement
A PGQL statement is precompiled and stored in a PreparedStatement object. This object can then be used to efficiently execute this statement multiple times. Bind variables can be used to efficient execute parameterized queries.
A typical usage is shown below.
PgqlConnection pgqlConn = PgqlConnection.getConnection(conn);
// If schema is not specified, JDBC Connection schema is used
pgqlConn.setSchema("SCOTT");
pgqlConn.setGraph("GRAPH");
String pgqlString = "SELECT n.name FROM MATCH (n) WHERE id(n) = ?";
PgqlPreparedStatement ps = pgqlConn.prepareStatement(pgqlString);
ps.setInt(1, 4);
PgqlResultSet rs = ps.executeQuery();
while(rs.next()) {
// process result (e.g., value of name column)
String nameVal = rs.getString("name");
}
rs.close();
ps.close();
Modifier and Type | Method and Description |
---|---|
default boolean |
execute()
Executes a PGQL Query, Modify or Create/Drop operation on this instance's property graph.
|
boolean |
execute(int parallel, int dynamicSampling, java.lang.String matchOptions, java.lang.String options)
Executes a PGQL Query, Modify or Create/Drop operation on this instance's property graph.
|
boolean |
execute(java.lang.String matchOptions, java.lang.String options)
Executes a PGQL Query, Modify or Create/Drop operation on this instance's property graph.
|
PgqlResultSet |
executeQuery()
Translates this instance's PGQL statement into a SQL statement and executes the SQL against this instance's property graph.
|
PgqlResultSet |
executeQuery(int timeout, int parallel, int dynamicSampling, int maxResults, java.lang.String options)
Translates this instance's PGQL statement into a SQL statement and executes the SQL against this instance's property graph.
|
void |
setBoolean(int parameterIndex, boolean x)
Sets the designated parameter to the given Java boolean value.
|
void |
setDouble(int parameterIndex, double x)
Sets the designated parameter to the given Java double value.
|
void |
setFloat(int parameterIndex, float x)
Sets the designated parameter to the given Java float value.
|
void |
setInt(int parameterIndex, int x)
Sets the designated parameter to the given Java int value.
|
void |
setLong(int parameterIndex, long x)
Sets the designated parameter to the given Java long value.
|
void |
setString(int parameterIndex, java.lang.String x)
Sets the designated parameter to the given Java String value.
|
void |
setTimestamp(int parameterIndex, java.sql.Timestamp x)
Sets the designated parameter to the given Java Timestamp value.
|
PgqlSqlQueryTrans |
translateQuery()
Translates this instance's PGQL statement into a SQL statement.
|
default PgqlSqlQueryTrans |
translateQuery(int parallel, int dynamicSampling, int maxResults, java.lang.String options)
Translates this instance's PGQL statement into a SQL statement.
|
default PgqlSqlTrans |
translateStatement()
Translates this instance's PGQL statement into a series of SQL statements.
|
PgqlSqlTrans |
translateStatement(int parallel, int dynamicSampling, int maxResults, java.lang.String matchOptions, java.lang.String options)
Translates this instance's PGQL statement into a series of SQL statements.
|
PgqlSqlTrans |
translateStatement(java.lang.String matchOptions, java.lang.String options)
Translates this instance's PGQL statement into a series of SQL statements.
|
cancel, close, execute, execute, execute, executeQuery, executeQuery, executeQuery, getBatchSize, getFetchSize, getModifyCount, getResultSet, setBatchSize, setFetchSize, translateQuery, translateQuery, translateQuery, translateStatement, translateStatement, translateStatement
default boolean execute() throws PgqlToSqlException, oracle.pgql.lang.PgqlException
execute
in interface oracle.pgql.lang.PreparedStatement
PgqlToSqlException
- if a server-side error occurs during translation or SQL executionoracle.pgql.lang.PgqlException
- if a server-side error occurs or this method is called on a closed Statementboolean execute(int parallel, int dynamicSampling, java.lang.String matchOptions, java.lang.String options) throws PgqlToSqlException, oracle.pgql.lang.PgqlException
Supported query options (matchOptions) are the same as those for executeQuery.
Supported modify options are:
STREAMING=T Use result sets instead of temporary tables to perform the update.
AUTO_COMMIT=F Do not commit after performing the modify operation.
DELETE_CASCADE=F Do not delete incoming/outgoing edges when deleting a vertex.
parallel
- the degree of parallelism to use for query and update executiondynamicSampling
- the value for dynamic samplingmatchOptions
- additional options used to influence query translation and executionoptions
- additional options used to influence modify translation and executionPgqlToSqlException
- if a server-side error occurs during translation or SQL executionoracle.pgql.lang.PgqlException
- if a server-side error occurs or this method is called on a closed Statementboolean execute(java.lang.String matchOptions, java.lang.String options) throws PgqlToSqlException, oracle.pgql.lang.PgqlException
Supported query options (matchOptions) are the same as those for executeQuery.
Supported modify options are:
STREAMING=T Use result sets instead of temporary tables to perform update.
AUTO_COMMIT=F Do not commit after performing the modify operation.
DELETE_CASCADE=F Do not delete incoming/outgoing edges when deleting a vertex.
matchOptions
- additional options used to influence query translation and executionoptions
- additional options used to influence modify translation and executionPgqlToSqlException
- if a server-side error occurs during translation or SQL executionoracle.pgql.lang.PgqlException
- if a server-side error occurs or this method is called on a closed StatementPgqlResultSet executeQuery() throws PgqlToSqlException, oracle.pgql.lang.PgqlException
executeQuery
in interface oracle.pgql.lang.PreparedStatement
PgqlResultSet
object with the result of the provided PGQL queryPgqlToSqlException
- if a server-side error occurs during translation or SQL executionoracle.pgql.lang.PgqlException
- if a server-side error occurs or this method is called on a closed StatementPgqlResultSet executeQuery(int timeout, int parallel, int dynamicSampling, int maxResults, java.lang.String options) throws PgqlToSqlException, oracle.pgql.lang.PgqlException
Supported query options are:
USE_RW=F Use CONNECT BY instead of recursive WITH for unbounded path traversals.
MAX_PATH_LEN=n Traverse at most n hops when evaluating unbounded path traversals.
EDGE_SET_PARTIAL=T Fetch properties for each start and end vertex found when reading edges from the query result.
timeout
- the number of seconds for query execution to finishparallel
- the degree of parallelism to use for query executiondynamicSampling
- the value for dynamic samplingmaxResults
- the maximum number of rows returnedoptions
- additional options used to influence query translation and executionPgqlResultSet
object with the result of the provided PGQL queryPgqlToSqlException
- if a server-side error occurs during translation or SQL executionoracle.pgql.lang.PgqlException
- if a server-side error occurs or this method is called on a closed Statementvoid setBoolean(int parameterIndex, boolean x)
setBoolean
in interface oracle.pgql.lang.PreparedStatement
parameterIndex
- the first parameter is 1, the second is 2, ...x
- the parameter valuevoid setDouble(int parameterIndex, double x)
setDouble
in interface oracle.pgql.lang.PreparedStatement
parameterIndex
- the first parameter is 1, the second is 2, ...x
- the parameter valuevoid setFloat(int parameterIndex, float x)
setFloat
in interface oracle.pgql.lang.PreparedStatement
parameterIndex
- the first parameter is 1, the second is 2, ...x
- the parameter valuevoid setInt(int parameterIndex, int x)
setInt
in interface oracle.pgql.lang.PreparedStatement
parameterIndex
- the first parameter is 1, the second is 2, ...x
- the parameter valuevoid setLong(int parameterIndex, long x)
setLong
in interface oracle.pgql.lang.PreparedStatement
parameterIndex
- the first parameter is 1, the second is 2, ...x
- the parameter valuevoid setString(int parameterIndex, java.lang.String x)
setString
in interface oracle.pgql.lang.PreparedStatement
parameterIndex
- the first parameter is 1, the second is 2, ...x
- the parameter valuevoid setTimestamp(int parameterIndex, java.sql.Timestamp x)
Timestamp values are assumed to be in Coordinated Universal Time (UTC).
parameterIndex
- the first parameter is 1, the second is 2, ...x
- the parameter valuePgqlSqlQueryTrans translateQuery() throws PgqlToSqlException, oracle.pgql.lang.PgqlException
PgqlSqlTrans
object with the SQL translation and column metadata for the provided PGQL queryPgqlToSqlException
- if a server-side error occurs during translationoracle.pgql.lang.PgqlException
- if a server-side error occurs or this method is called on a closed Statementdefault PgqlSqlQueryTrans translateQuery(int parallel, int dynamicSampling, int maxResults, java.lang.String options) throws PgqlToSqlException, oracle.pgql.lang.PgqlException
Supported query options are:
USE_RW=F Use CONNECT BY instead of recursive WITH for unbounded path traversals.
MAX_PATH_LEN=n Traverse at most n hops when evaluating unbounded path traversals.
EDGE_SET_PARTIAL=T Fetch properties for each start and end vertex found when reading edges from the query result.
parallel
- the degree of parallelism to use for query executiondynamicSampling
- the value for dynamic samplingmaxResults
- the maximum number of rows returnedoptions
- additional options used to influence query translationPgqlSqlTrans
object with the SQL translation and column metadata for the provided PGQL queryPgqlToSqlException
- if a server-side error occurs during translationoracle.pgql.lang.PgqlException
- if a server-side error occurs or this method is called on a closed Statementdefault PgqlSqlTrans translateStatement() throws PgqlToSqlException, oracle.pgql.lang.PgqlException
PgqlToSqlException
- if a server-side error occurs during translationoracle.pgql.lang.PgqlException
- if a server-side error occurs or this method is called on a closed StatementPgqlSqlTrans translateStatement(int parallel, int dynamicSampling, int maxResults, java.lang.String matchOptions, java.lang.String options) throws PgqlToSqlException, oracle.pgql.lang.PgqlException
parallel
- the degree of parallelism to use for query executiondynamicSampling
- the value for dynamic samplingmaxResults
- the maximum number of rows returnedmatchOptions
- additional options used to influence query translation and executionoptions
- additional options used to influence DDL/DML translation and executionPgqlToSqlException
- if a server-side error occurs during translationoracle.pgql.lang.PgqlException
- if a server-side error occurs or this method is called on a closed StatementPgqlSqlTrans translateStatement(java.lang.String matchOptions, java.lang.String options) throws PgqlToSqlException, oracle.pgql.lang.PgqlException
matchOptions
- additional options used to influence query translation and executionoptions
- additional options used to influence DDL/DML translation and executionPgqlToSqlException
- if a server-side error occurs during translationoracle.pgql.lang.PgqlException
- if a server-side error occurs or this method is called on a closed Statement