public class PgqlExecution extends java.lang.Object implements PgqlPreparedStatement
PgqlStatement
and PgqlPreparedStatement
interfaces for executing PGQL queries against graphs stored in Oracle Database.
Refer to the documentation of these interfaces for further explanation and sample code.
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
USER_REQUESTED_CANCEL_ERROR |
Modifier and Type | Method and Description |
---|---|
void |
cancel()
Allows to cancel currently running execute operation.
|
void |
close()
Releases this PgqlStatment's database and JDBC resources.
|
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 pgql, 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.
|
boolean |
execute(java.lang.String pgql, 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.
|
PgqlResultSet |
executeQuery(java.lang.String pgql, 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.
|
PgqlResultSet |
executeQuery(java.lang.String pgql, java.lang.String options)
Translates this instance's PGQL statement into a SQL statement and executes the SQL against this instance's property graph.
|
int |
getBatchSize()
Returns the number of commands that should be batched when executing updates
|
int |
getFetchSize()
Returns the the number of rows that should be fetched from the database when more rows are needed for a query result.
|
long |
getModifyCount()
Returns the number of rows that were modified by last execute operation
|
PgqlResultSet |
getResultSet()
Returns the current result as a PgqlResultSet object.
|
void |
setArray(int parameterIndex, java.util.List<?> x)
Sets the designated parameter to the given Java List value.
|
void |
setBatchSize(int batchSize)
Sets the number of commands that should be batched when executing updates
|
void |
setBoolean(int parameterIndex, boolean x)
Sets the designated parameter to the given Java boolean value.
|
void |
setDate(int parameterIndex, java.time.LocalDate x)
Sets the designated parameter to the given Java LocalDate value.
|
void |
setDouble(int parameterIndex, double x)
Sets the designated parameter to the given Java double value.
|
void |
setFetchSize(int fetchSize)
Sets the number of rows that should be fetched from the database when more rows are needed for a query result.
|
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 |
setTime(int parameterIndex, java.time.LocalTime x)
Sets the designated parameter to the given Java LocalTime value.
|
void |
setTimestamp(int parameterIndex, java.time.LocalDateTime x)
Sets the designated parameter to the given Java LocalDateTime value.
|
void |
setTimestamp(int parameterIndex, java.sql.Timestamp x)
Sets the designated parameter to the given Java Timestamp value.
|
void |
setTimestampWithTimezone(int parameterIndex, java.time.OffsetDateTime x)
Sets the designated parameter to the given Java OffsetDateTime value.
|
void |
setTimeWithTimezone(int parameterIndex, java.time.OffsetTime x)
Sets the designated parameter to the given Java OffsetTime value.
|
PgqlSqlQueryTrans |
translateQuery()
Translates this instance's PGQL statement into a SQL statement.
|
PgqlSqlQueryTrans |
translateQuery(java.lang.String pgql, int parallel, int dynamicSampling, int maxResults, java.lang.String options)
Translates this instance's PGQL statement into a SQL statement.
|
PgqlSqlQueryTrans |
translateQuery(java.lang.String pgql, java.lang.String options)
Translates this instance's PGQL statement into a SQL statement.
|
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 pgql, int parallel, int dynamicSampling, int maxResults, java.lang.String matchOptions, java.lang.String options)
Translates the given 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.
|
PgqlSqlTrans |
translateStatement(java.lang.String pgql, java.lang.String matchOptions, java.lang.String options)
Translates the given PGQL statement into a series of SQL statements.
|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
execute, translateQuery
execute, executeQuery, translateQuery, translateStatement
public static final java.lang.String USER_REQUESTED_CANCEL_ERROR
public void cancel() throws oracle.pgql.lang.PgqlException
PgqlStatement
cancel
in interface PgqlStatement
oracle.pgql.lang.PgqlException
- When an error occurs while canceling current operation.public void close() throws oracle.pgql.lang.PgqlException
close
in interface java.lang.AutoCloseable
close
in interface PgqlStatement
close
in interface oracle.pgql.lang.PreparedStatement
oracle.pgql.lang.PgqlException
public boolean 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.
execute
in interface PgqlPreparedStatement
parallel
- the degree of parallelism to use for query and modify 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 Statementpublic boolean execute(java.lang.String pgql, 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.
execute
in interface PgqlStatement
pgql
- the PGQL modify to executeparallel
- 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 Statementpublic boolean 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.
execute
in interface PgqlPreparedStatement
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 Statementpublic boolean execute(java.lang.String pgql, 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.
execute
in interface PgqlStatement
pgql
- the PGQL to executematchOptions
- 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 Statementpublic PgqlResultSet executeQuery() throws PgqlToSqlException, oracle.pgql.lang.PgqlException
executeQuery
in interface PgqlPreparedStatement
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 Statementpublic PgqlResultSet 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.
executeQuery
in interface PgqlPreparedStatement
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 Statementpublic PgqlResultSet executeQuery(java.lang.String pgql, 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.
executeQuery
in interface PgqlStatement
pgql
- the PGQL query to executetimeout
- 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 Statementpublic PgqlResultSet executeQuery(java.lang.String pgql, 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.
executeQuery
in interface PgqlStatement
pgql
- the PGQL query to executeoptions
- 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 Statementpublic int getBatchSize()
getBatchSize
in interface PgqlStatement
public int getFetchSize()
getFetchSize
in interface PgqlStatement
public long getModifyCount()
PgqlStatement
getModifyCount
in interface PgqlStatement
public PgqlResultSet getResultSet()
getResultSet
in interface PgqlStatement
getResultSet
in interface oracle.pgql.lang.PreparedStatement
PgqlResultSet
object with the result of the last executed PGQL query, or null if the query last executed PGQL was not a Select statementpublic void setArray(int parameterIndex, java.util.List<?> x)
setArray
in interface oracle.pgql.lang.PreparedStatement
parameterIndex
- the first parameter is 1, the second is 2, ...x
- the parameter valuepublic void setBatchSize(int batchSize)
setBatchSize
in interface PgqlStatement
batchSize
- the update batch sizepublic void setBoolean(int parameterIndex, boolean x)
setBoolean
in interface PgqlPreparedStatement
setBoolean
in interface oracle.pgql.lang.PreparedStatement
parameterIndex
- the first parameter is 1, the second is 2, ...x
- the parameter valuepublic void setDate(int parameterIndex, java.time.LocalDate x)
setDate
in interface oracle.pgql.lang.PreparedStatement
parameterIndex
- the first parameter is 1, the second is 2, ...x
- the parameter valuepublic void setDouble(int parameterIndex, double x)
setDouble
in interface PgqlPreparedStatement
setDouble
in interface oracle.pgql.lang.PreparedStatement
parameterIndex
- the first parameter is 1, the second is 2, ...x
- the parameter valuepublic void setFetchSize(int fetchSize)
setFetchSize
in interface PgqlStatement
fetchSize
- the query fetch sizepublic void setFloat(int parameterIndex, float x)
setFloat
in interface PgqlPreparedStatement
setFloat
in interface oracle.pgql.lang.PreparedStatement
parameterIndex
- the first parameter is 1, the second is 2, ...x
- the parameter valuepublic void setInt(int parameterIndex, int x)
setInt
in interface PgqlPreparedStatement
setInt
in interface oracle.pgql.lang.PreparedStatement
parameterIndex
- the first parameter is 1, the second is 2, ...x
- the parameter valuepublic void setLong(int parameterIndex, long x)
setLong
in interface PgqlPreparedStatement
setLong
in interface oracle.pgql.lang.PreparedStatement
parameterIndex
- the first parameter is 1, the second is 2, ...x
- the parameter valuepublic void setString(int parameterIndex, java.lang.String x)
setString
in interface PgqlPreparedStatement
setString
in interface oracle.pgql.lang.PreparedStatement
parameterIndex
- the first parameter is 1, the second is 2, ...x
- the parameter valuepublic void setTime(int parameterIndex, java.time.LocalTime x)
setTime
in interface oracle.pgql.lang.PreparedStatement
parameterIndex
- the first parameter is 1, the second is 2, ...x
- the parameter valuepublic void setTimestamp(int parameterIndex, java.time.LocalDateTime x)
setTimestamp
in interface oracle.pgql.lang.PreparedStatement
parameterIndex
- the first parameter is 1, the second is 2, ...x
- the parameter valuepublic void setTimestamp(int parameterIndex, java.sql.Timestamp x)
Timestamp values are assumed to be in Coordinated Universal Time (UTC).
setTimestamp
in interface PgqlPreparedStatement
parameterIndex
- the first parameter is 1, the second is 2, ...x
- the parameter valuepublic void setTimestampWithTimezone(int parameterIndex, java.time.OffsetDateTime x)
setTimestampWithTimezone
in interface oracle.pgql.lang.PreparedStatement
parameterIndex
- the first parameter is 1, the second is 2, ...x
- the parameter valuepublic void setTimeWithTimezone(int parameterIndex, java.time.OffsetTime x)
setTimeWithTimezone
in interface oracle.pgql.lang.PreparedStatement
parameterIndex
- the first parameter is 1, the second is 2, ...x
- the parameter valuepublic PgqlSqlQueryTrans translateQuery() throws PgqlToSqlException, oracle.pgql.lang.PgqlException
translateQuery
in interface PgqlPreparedStatement
PgqlSqlQueryTrans
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 Statementpublic PgqlSqlQueryTrans translateQuery(java.lang.String pgql, 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.
translateQuery
in interface PgqlStatement
pgql
- the PGQL query to translateparallel
- 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 translationPgqlSqlQueryTrans
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 Statementpublic PgqlSqlQueryTrans translateQuery(java.lang.String pgql, 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.
translateQuery
in interface PgqlStatement
pgql
- the PGQL query to translateoptions
- additional options used to influence query translationPgqlSqlQueryTrans
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 Statementpublic PgqlSqlTrans translateStatement() throws PgqlToSqlException, oracle.pgql.lang.PgqlException
PgqlPreparedStatement
translateStatement
in interface PgqlPreparedStatement
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 Statementpublic PgqlSqlTrans translateStatement(int parallel, int dynamicSampling, int maxResults, java.lang.String matchOptions, java.lang.String options) throws PgqlToSqlException, oracle.pgql.lang.PgqlException
PgqlPreparedStatement
translateStatement
in interface PgqlPreparedStatement
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 Statementpublic PgqlSqlTrans translateStatement(java.lang.String pgql, int parallel, int dynamicSampling, int maxResults, java.lang.String matchOptions, java.lang.String options) throws PgqlToSqlException, oracle.pgql.lang.PgqlException
PgqlStatement
translateStatement
in interface PgqlStatement
pgql
- the PGQL statement to translateparallel
- 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 Statementpublic PgqlSqlTrans translateStatement(java.lang.String matchOptions, java.lang.String options) throws PgqlToSqlException, oracle.pgql.lang.PgqlException
PgqlPreparedStatement
translateStatement
in interface PgqlPreparedStatement
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 Statementpublic PgqlSqlTrans translateStatement(java.lang.String pgql, java.lang.String matchOptions, java.lang.String options) throws PgqlToSqlException, oracle.pgql.lang.PgqlException
PgqlStatement
translateStatement
in interface PgqlStatement
pgql
- the PGQL statement to translatematchOptions
- 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