public String runQuery(String q) throws JsonGenerationException, JsonMappingException
{
Graph g = null;
try {
g = jdbcTemplate.query(q, new Neo4jGraphResultSetExtractor());
} catch (DataAccessException e) {
if (e instanceof UncategorizedSQLException)
{
//Invalid cypher query
throw (UncategorizedSQLException)e;
}
else throw e;
}
json = g.toJson(); //throws JsonGenerationException, JsonMappingException
return json;
}
编译器是否应该要求此方法也抛出UncategorizedSQLException
,DataAccessException
?