PreparedStatement pstmt = connection.prepareStatement(sqlString);
QueryExecution qe = QueryExecutionFactory.create(SPARQL_QUERY, model);
Which is better in performance PreparedStatement or QueryExecutionFactory? As there is no class called
PreparedStatement in Jena. I mean we have sqlstatement as precompiled when we used PreparedStatement in java,
is it same with Jena?
PreparedStatement is a JDBC thing. The Jena query execution (through Jena Adapter) will use prepared statement to execute a SQL query (translated from a SPARQL query). So there is no performance difference as long as the same query is executed.
Say i use Same query and run it using.
1. JDBC PreparedStatement creating a SEM_MATCH query
2. Jena API creating SPARQL query
Where in both cases query is same but created in a different way (using 1.SEM_MATCH and 2. SPARQL)
So which will give better performance?
Thanks and Regards,
A SPARQL query will be translated to a SEM_MATCH based SQL. So performance will be the same. If you use S2S, then you can save some parse time for new SPARQL queries. For details, please see the dev guide.