question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add @Throws(java.sql.SqlException)

See original GitHub issue

Description

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:closed
  • Created a year ago
  • Comments:6

github_iconTop GitHub Comments

1reaction
AlecStrongcommented, Oct 3, 2022

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

0reactions
DevPJ9commented, Oct 1, 2022

Thanks, @hfhbd for the clarification.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found