public class Session extends Object
| Constructor and Description |
|---|
Session(SyncConnection connection,
AuthResult authResult,
NebulaPool connPool,
Boolean retryConnect)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
ResultSet |
execute(String stmt)
Execute the nGql sentence.
|
String |
executeJson(String stmt)
Execute the nGql sentence.
|
String |
executeJsonWithParameter(String stmt,
Map<String,Object> parameterMap)
Execute the nGql sentence.
|
ResultSet |
executeWithParameter(String stmt,
Map<String,Object> parameterMap)
Execute the nGql sentence.
|
HostAddress |
getGraphHost()
Gets the service address of the current connection
|
boolean |
ping()
Check current connection is ok
|
void |
release()
Notifies the server that the session is no longer needed
and returns the connection to the pool,
and the connection will be reuse.
|
public Session(SyncConnection connection, AuthResult authResult, NebulaPool connPool, Boolean retryConnect)
connection - the connection from the poolauthResult - the auth result from graph serviceconnPool - the connection poolretryConnect - whether to retry after the connection is disconnectedpublic ResultSet execute(String stmt) throws IOErrorException
stmt - The nGql sentence.
such as insert ngql `INSERT VERTEX person(name) VALUES "Tom":("Tom");`IOErrorExceptionpublic ResultSet executeWithParameter(String stmt, Map<String,Object> parameterMap) throws IOErrorException
stmt - The nGql sentence.
such as insert ngql `INSERT VERTEX person(name) VALUES "Tom":("Tom");`parameterMap - The nGql parameter mapIOErrorExceptionpublic String executeJson(String stmt) throws IOErrorException
stmt - The nGql sentence.
such as insert ngql `INSERT VERTEX person(name) VALUES "Tom":("Tom");`
parameterMap The nGql parametersIOErrorExceptionpublic String executeJsonWithParameter(String stmt, Map<String,Object> parameterMap) throws IOErrorException
stmt - The nGql sentence.
such as insert ngql `INSERT VERTEX person(name) VALUES "Tom":("Tom");`
parameterMap The nGql parametersIOErrorExceptionpublic boolean ping()
public void release()
public HostAddress getGraphHost()
Copyright © 2022. All rights reserved.