How to do connection from java application to TigerGraph database

------------------------------------------------------Code--------------------------------

String query = "get vertex(Person) ";
try (java.sql.PreparedStatement pstmt = con.prepareStatement(query)) {
				
					try (java.sql.ResultSet rs = pstmt.executeQuery()) {
						printResultSet(rs);
					}
				} catch (SQLException e) {
					System.out.println("Failed to createStatement: " + e);
				}

-------------------------------------------------ERROR-------------------------------------------------
Failed to execute query: request: GET http://ipaddress:9000/restpp/graph/Social/vertices/Person HTTP/1.1, payload size: 0

java.sql.SQLException: Failed to send request: 404 - Not Found. REST-1000: Endpoint is not found from url = /restpp/graph/Social/vertices/Person, please use GET /endpoints to list all valid endpoints.

at com.tigergraph.jdbc.restpp.driver.RestppResponse.(RestppResponse.java:81)

at com.tigergraph.jdbc.restpp.RestppConnection.executeQuery(RestppConnection.java:651)

at com.tigergraph.jdbc.restpp.RestppPreparedStatement.execute(RestppPreparedStatement.java:94)

at com.tigergraph.jdbc.restpp.RestppPreparedStatement.executeQuery(RestppPreparedStatement.java:69)

at com.tigergraph.jdbc.examples.RunQuery2.main(RunQuery2.java:106)

e[0m

Failed to createStatement: java.sql.SQLException: Failed to execute query: request: GET http://ipaddress:9000/restpp/graph/Social/vertices/Person HTTP/1.1, payload size: 0

Hello.
This is using the TigerGraph JDBC connector, correct?

I see an extra space at the end of the query string, but I assume that is not the problem.

Is the REST API authentication enabled?

gadmin config set RESTPP.Factory.EnableAuth true Encountered " "" "$ “” at line 1, column 1.
Was expecting one of:
“@” …
“abort” …
seems command given in the documentation is not correct

yes removed and tried…no luck

Hi Kamal. Please kindly check if you are using the right port 14240 instead of 9000 when creating the connection. You can take a look at the below snippet for reference

try {
  com.tigergraph.jdbc.Driver driver = new Driver();
  try (Connection con =
      driver.connect("jdbc:tg:http://127.0.0.1:14240", properties)) {
    try (Statement stmt = con.createStatement()) {```

Hi Ryanwang,
As you mentioned above, connection code and tigergraph should be placed in same server?
In Our case, application(windows) and tigergraph(Linux) are placed in two different servers.

Could you please provide java jdbc tigergraph connection source code with an example. so that we can follow same.

Thanks,
Sateesh

Ryanwang, Thank you ! it is working with port change. got into new issue
getting ERROR: unsupported db Table Person… thought it exits and able to query (select query: select * from Person limit 100) from GSQL and Python code.

can you suggest a fix?

Hi Kamal

It looks like the URL is still wrong with a single quote at ‘Person’. Please submit a ticket at https://tigergraph.zendesk.com/ for further investigation.