Add @Throws(java.sql.SqlException)
See original GitHub issueDescription
Although Sqldelight focus on Kotlin, you could still use the generated query methods with Java. With plain JDBC API you need to check the possible SqlException. Without the @Throws
annotation, the java compiler does not enforce you to catch the exception, which could crash your program unexepted.
Issue Analytics
- State:
- Created a year ago
- Comments:6
Top Results From Across the Web
Java -- Exception must be thrown, but how? - Stack Overflow
This is why I created the getCustomerInfo() method. This method does throw the exception, because it uses a method to retrieve information from ......
Read more >java.sql.SQLException java code examples - Tabnine
How to get the insert ID in JDBC? public void create(User user) throws SQLException { try ( Connection connection = dataSource.
Read more >JDBC Exception Handling - How To Handle SQL Exceptions
JDBC -related exception mostly throws SQLException, and it is a checked exception so we must either catch it or throw it. All the...
Read more >Handling SQLExceptions - JDBC Basics - Oracle Help Center
When JDBC encounters an error during an interaction with a data source, it throws an instance of SQLException as opposed to Exception ....
Read more >How to Throw Exceptions in Java - Rollbar
Throwing an exception is as simple as using the "throw" statement. You then specify the Exception object you wish to throw. Every Exception ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Its a little annoying in how much it propagates through all aspects of the library. Drivers, codegen, runtime, all get the annotations. In general even though you could still write java, because the library forces you to have kotlin enabled we just explicitly don’t optimize things for java
Thanks, @hfhbd for the clarification.