You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2019/04/29 09:00:57 UTC
[GitHub] [incubator-shardingsphere] jimmycheng888 opened a new issue #2302:
ShardingPreparedStatement Class exception not caught
jimmycheng888 opened a new issue #2302: ShardingPreparedStatement Class exception not caught
URL: https://github.com/apache/incubator-shardingsphere/issues/2302
**Which version of ShardingSphere did you use?**
3.1.0
**Which project did you use? Sharding-JDBC or Sharding-Proxy?**
Sharding-JDBC
`Actual behavior`
The code exception is not caught, causing a null pointer exception, and does not throw a true exception, making it impossible for the developer to accurately determine what went wrong.
**Example codes for reproduce this issue (such as a github link).**
The code packge is : io.shardingsphere.shardingjdbc.jdbc.core.statement
For example, the following code, the special symbol will be a direct null pointer, and the real reason is not exposed.
```
@Override
public boolean execute() throws SQLException {
try {
clearPrevious();
sqlRoute();
initPreparedStatementExecutor();
return preparedStatementExecutor.execute();
} finally {
refreshTableMetaData(connection.getShardingContext(), routeResult.getSqlStatement());
clearBatch();
}
}
```
----------------------------------------------------------------
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:
users@infra.apache.org
With regards,
Apache Git Services