java - Why doesn't SQLException extends IOException? -
as client, when "bad" happens input / output of program, i/o exception should thrown. when i'm connected server, program has input-output-relationship client said server. therefore, when on communication doesn't work (something "bad"), resulting exception should ioexception, i.e. sqlexception should extend ioexception.
why not case?
because sqlexception
not related io.
for example if write bad sql command have sqlexception
.
here non exhaustive list of possible sqlexceptions not related io:
- bad sql grammar
- wrong attribute numbers
- wrong attribute types
- constraint violation
- privilege problems
- duplicate primary keys
- not existing table or column names
from javadoc:
an exception provides information on database access error or other errors.
Comments
Post a Comment