seo-kw commented on issue #76:
URL: https://github.com/apache/incubator-age/issues/76#issuecomment-850272683


   > 
   > 
   > I haven't used JDBC myself, but if it is similar to asyncpg, it should 
work like this:
   > 
   > ```
   > PreparedStatement pstmt  = 
connectionHelper.createConnection().prepareStatement(
   >    "select * from cypher('a', $$ "+
   >    "match (a) where id(a) = $id return properties(a)" +
   >    "$$, ?) as (a agtype););"
   > pstmt.setString(1, '{\"id\": 281474976710667}');
   > ```
   > 
   > Additional remark: `id(a)` (automatically generated primary key for the 
vertex a) is not the same as `a.id` (property id of the vertex a).
   
   ----
   Hi potter. I just closed this issue by mistake. Sorry for the confusion. And 
thanks for your reply.
   
   But I didn't solve the previous problem you suggested.
   
   I just applied your solution below.
   
   ```            
   PreparedStatement pstmt  = 
connectionHelper.createConnection().prepareStatement(
           "select * from cypher('a', $$ "+
           "match (a) where a.id = $id return properties(a)" +
           "$$, ?) as (a agtype););");
   pstmt.setString(1, "{\"id\": 281474976710667}");
   
   ```
   I check this syntax in AGE_Guide.pdf  "Prepared Statements" paragraph. and 
maybe I know what you meant to.
   but I got errors below.
   
   `
   org.postgresql.util.PSQLException: ERROR: function cypher(unknown, unknown, 
character varying) does not exist
     Hint: No function matches the given name and argument types. You might 
need to add explicit type casts.
   `
   
   Maybe character '?' is recognized to character varying and it's not accepted 
in function.
   
   Anyway, I appreciate your feedback.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to