[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.rt.eclipselink] Re: Thrown exceptions are useless

James wrote:
Not sure what you mean, the cause is in your stack,

Caused by: java.sql.SQLException: No suitable driver
at java.sql.DriverManager.getConnection(DriverManager.java:545)
at java.sql.DriverManager.getConnection(DriverManager.java:140)
at org.eclipse.persistence.sessions.DefaultConnector.connect(DefaultConnector.java:97)


.. 32 more

This is the exception being thrown by java.sql.DriverManager, it means that you have no registered JDBC driver for the URL you are using. Did you set the driver-class?

The real exception is an E/A Error reported BY THE DRIVER (Orcale). The driver is loaded and running (inside OSGi). The connection could not be established because of a network error. Can you see that anywhere in the stacktrace? Thats why I complained about the exception wrapping that does not expose, but swallow the real exception (hidden inside the SQLException). EL should extract the cause from SQLException and then wrap it if that is even a good idea. I think SQLException is already a wrapper exception, just throw it up.