java.sql2.SqlException

Douglas Surber douglas.surber at oracle.com
Mon Oct 9 14:58:38 UTC 2017


I don’t think java.sql2.SqlException is actually used anywhere in the API. As Lance said, this is a placeholder and more discussion is needed.

Douglas

> On Oct 9, 2017, at 4:26 AM, Lance Andersen <lance.andersen at oracle.com> wrote:
> 
> Thank you for the feedback….
>> On Oct 9, 2017, at 3:36 AM, Lukas Eder <lukas.eder at gmail.com <mailto:lukas.eder at gmail.com>> wrote:
>> 
>> I'm not sure how I missed this when I reviewed the API, but I most
>> certainly agree with Philippe's points 1) and 3)
>> 
>> The dependency on java.sql was also discussed in the context of having an
>> independent (or not) JdbcType class:
>> http://mail.openjdk.java.net/pipermail/jdbc-spec-discuss/ <http://mail.openjdk.java.net/pipermail/jdbc-spec-discuss/>
>> 2017-October/000105.html
>> 
>> As far as checked exceptions are concerned, they were indeed the wrong
>> choice for all things related to system exceptions (which includes the old
>> SQLException and IOException).
> 
> Just like with JDBCType, this is somewhat of a placeholder so don’t read too much into it right now.  There is more discussion to be had around Exceptions.
> 
> Best
> Lance
>> 
>> I don't have an opinion on 2) naming :)
>> 
>> Thanks,
>> Lukas
>> 
>> 2017-10-09 9:18 GMT+02:00 Philippe Marschall <pm at netcetera.ch>:
>> 
>>> Hello
>>> 
>>> I think SqlException extending SQLException is not ideal for several
>>> reasons
>>> 
>>> 1. It introduces a dependency on the java.sql module which in term brings
>>> dependencies to the java.xml and java.logging modules. This sorta, kinda
>>> defeats the idea behind building minimal runtime images.
>>> 
>>> 2. It is super confusing to have two different capitalisations (I realize
>>> JDBC does not follow Java naming conventions).
>>> 
>>> 3. It is a checked exception. There is broad consensus that checked
>>> exceptions in practice do not bring the benefits once envisioned plus bring
>>> a lot of downsides. All the new APIs that I'm aware of use runtime /
>>> unchecked exceptions instead of checked exceptions. This is especially true
>>> for all the functional/stream interfaces in Java 8, hence things like
>>> java.io.UncheckedIOException.
>>> 
>>> Cheers
>>> Philippe
>>> 
> 
> <http://oracle.com/us/design/oracle-email-sig-198324.gif <http://oracle.com/us/design/oracle-email-sig-198324.gif>>
> <http://oracle.com/us/design/oracle-email-sig-198324.gif <http://oracle.com/us/design/oracle-email-sig-198324.gif>> <http://oracle.com/us/design/oracle-email-sig-198324.gif <http://oracle.com/us/design/oracle-email-sig-198324.gif>>
> <http://oracle.com/us/design/oracle-email-sig-198324.gif <http://oracle.com/us/design/oracle-email-sig-198324.gif>>Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037
> Oracle Java Engineering 
> 1 Network Drive 
> Burlington, MA 01803
> Lance.Andersen at oracle.com <mailto:Lance.Andersen at oracle.com> <mailto:Lance.Andersen at oracle.com <mailto:Lance.Andersen at oracle.com>>



More information about the jdbc-spec-discuss mailing list