public interface OraclePgqlPreparedStatement extends OraclePgqlStatement
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.
Oracle oracle = new Oracle(jdbcUrl,user,password);
OraclePropertyGraph graph = OraclePropertyGraph.getInstance(oracle,graphName);
String pgqlString = "SELECT n.name WHERE (n WITH id()=?)";
OraclePgqlPreparedStatement opps =
OraclePgqlExecutionFactory.prepareStatement(graph, pgqlString);
opps.setInt(1, 4);
OraclePgqlResultSet oprs = opps.executeQuery("USE_GT_TAB=T");
OraclePgqlResultSetMetaData rsmd = oprs.getMetaData();
Iterator<OraclePgqlResult> itr = oprs.getResults().iterator();
while(itr.hasNext()) {
OraclePgqlResult opr = itr.next();
for (int i = 1; i <= rsmd.getColumnCount(); i++) {
OraclePgqlColumnDescriptor.Type t = opr.getColumnType(i);
switch (t) {
case VERTEX:
// process vertex
break;
case EDGE:
// process edge
break;
case VALUE:
// process value
break;
}
}
}
oprs.close();
opps.close();
Modifier and Type | Method and Description |
---|---|
OraclePgqlResultSet |
executeQuery(int timeout, int parallel, long queryID, 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.
|
OraclePgqlResultSet |
executeQuery(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.
|
OraclePgqlSqlTrans |
translateQuery(int parallel, int dynamicSampling, int maxResults, java.lang.String options)
Translates this instance's PGQL statement into a SQL statement.
|
OraclePgqlSqlTrans |
translateQuery(java.lang.String options)
Translates this instance's PGQL statement into a SQL statement.
|
close, executeQuery, executeQuery, getFetchSize, setFetchSize, translateQuery, translateQuery
OraclePgqlResultSet executeQuery(int timeout, int parallel, long queryID, int dynamicSampling, int maxResults, java.lang.String options) throws PgqlToSqlException, oracle.pgql.lang.PgqlException, java.sql.SQLException
Supported query options are:
USE_GT_TAB=T Use the GRAPH_NAMEGT$ table instead of the GRAPH_NAMEGE$ table for evaluating edge traversals.
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 executionqueryID
- the query IDdynamicSampling
- the value for dynamic samplingmaxResults
- the maximum number of rows returnedoptions
- additional options used to influence query translation and executionOraclePgqlResultSet
object with the result of the provided PGQL queryPgqlToSqlException
oracle.pgql.lang.PgqlException
java.sql.SQLException
OraclePgqlResultSet executeQuery(java.lang.String options) throws PgqlToSqlException, oracle.pgql.lang.PgqlException, java.sql.SQLException
Supported query options are:
USE_GT_TAB=T Use the GRAPH_NAMEGT$ table instead of the GRAPH_NAMEGE$ table for evaluating edge traversals.
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.
options
- additional options used to influence query translation and executionOraclePgqlResultSet
object with the result of the provided PGQL queryPgqlToSqlException
oracle.pgql.lang.PgqlException
java.sql.SQLException
void setBoolean(int parameterIndex, boolean x)
parameterIndex
- the first parameter is 1, the second is 2, ...x
- the parameter valuevoid setDouble(int parameterIndex, double x)
parameterIndex
- the first parameter is 1, the second is 2, ...x
- the parameter valuevoid setFloat(int parameterIndex, float x)
parameterIndex
- the first parameter is 1, the second is 2, ...x
- the parameter valuevoid setInt(int parameterIndex, int x)
parameterIndex
- the first parameter is 1, the second is 2, ...x
- the parameter valuevoid setLong(int parameterIndex, long x)
parameterIndex
- the first parameter is 1, the second is 2, ...x
- the parameter valuevoid setString(int parameterIndex, java.lang.String x)
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 valueOraclePgqlSqlTrans translateQuery(int parallel, int dynamicSampling, int maxResults, java.lang.String options) throws PgqlToSqlException, oracle.pgql.lang.PgqlException
Supported query options are:
USE_GT_TAB=T Use the GRAPH_NAMEGT$ table instead of the GRAPH_NAMEGE$ table for evaluating edge traversals.
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 translationOraclePgqlSqlTrans
object with the SQL translation and column metadata for the provided PGQL queryPgqlToSqlException
oracle.pgql.lang.PgqlException
OraclePgqlSqlTrans translateQuery(java.lang.String options) throws PgqlToSqlException, oracle.pgql.lang.PgqlException
Supported query options are:
USE_GT_TAB=T Use the GRAPH_NAMEGT$ table instead of the GRAPH_NAMEGE$ table for evaluating edge traversals.
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.
options
- additional options used to influence query translationOraclePgqlSqlTrans
object with the SQL translation and column metadata for the provided PGQL queryPgqlToSqlException
oracle.pgql.lang.PgqlException
Copyright © 2017, 2018 Oracle and/or its affiliates. All Rights Reserved.