Use SQLSTATE codes
It would be helpful if sqlite-jdbc could map SQLite error codes and conditions to SQLSTATE codes so that it is possible to determine the reason for a SQLException without parsing the error message. A common use case for this are serialization and locking errors.
Is there any standard for SQLSTATE codes?
The SQL standard defines the SQLSTATE codes. Various vendors document their SQLSTATE codes themselves because the SQL standard can only be purchased at a high price through the ISO and its members. A late draft of SQL:2003 and final drafts of SQL:2011 seem to be freely available on the Internet and SQL-92 also defines several SQLSTATE codes. However, I'm not sure whether all SQLite errors can be represented as standardized SQLSTATE codes and which revision of the SQL standard would be necessary to reference the codes.
OK. What types of SQLSTATE do you usually use?
I think classes 08, 09, 22, 23, 27 and 40 could apply. Class 23 looks very broad but most errors do not apply to SQLite. Classes 08 and 40 are the most important to me.
Is this still relevant?
If it has not changed, it is still relevant. However, I ended up writing my own JDBC driver.
If it has not changed, it is still relevant
I am asking as i am now helping to maintain this repo, but i can't go through the whole history for every single issue, especially those that are a few years old.
However, I ended up writing my own JDBC driver.
Nice, would you mind sharing this for information ? Did that solve the SQLState thing ?
Unfortunately, I can't share this for information. However, I did solve the issue with SQLSTATE by mapping the SQLite error codes as best as I could.
@ott do you still need this ticket, or can we close it?
I don't use this driver anymore and your question illustrates the reason for this decision. So if you don't wan to implement SQLSTATE codes and have a JDBC compliant driver, this ticket can be closed.