开发者

Is MySQL JDBC driver compliant with the JDBC spec?

I am using Connector/J 5.1.10 as the JDBC dri开发者_运维知识库ver for my Database application (which uses MySQL).

I have found that although the default ResultSet returned by a Statement is of type TYPE_FORWARD_ONLY, I am still able to safely call the previous() method on the ResultSet.

I also looked at the source code (com.mysql.jdbc.ResultSetImpl), and found out that it too does not do any checks for the type of the ResultSet.

Is Connector/J not fully compliant with the JDBC spec ?

Thanks.


The API documentation says that ResultSet#previous() should throw an SQLException "if ... the result set type is TYPE_FORWARD_ONLY", so I guess it's safe to assume that J/Connector violates the specification here.


According to the release notes the driver is compliant with all of the tests that Sun makes publicly available.

Some parts of the spec are vague, mysql specifically says so in the release notes. Perhaps the spec doesn't say what the vendor should do if you traverse back on a forward_only cursor ... the vendor has a choice whether to throw an exception at you or not.

The public tests can't test the parts of the spec where a decision is left to the vendor's discretion.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜