aspose file tools*
The moose likes JDBC and the fly likes About SQLWarning Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "About SQLWarning " Watch "About SQLWarning " New topic
Author

About SQLWarning

RaviNada Kiran
Ranch Hand

Joined: Jan 30, 2009
Posts: 528
SQLWarning warning = stmt.getWarnings();

Do we ever need to deal with the warnings associated on the Connection , Statement??


If you want something you never had do something which you had never done
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

Yes, if they are important to your application.


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
RaviNada Kiran
Ranch Hand

Joined: Jan 30, 2009
Posts: 528
Paul , Thanks for the reply.

Can you tell me any scenario , where a warning associated with a Connection/Statement might be useful for the application
RaviNada Kiran
Ranch Hand

Joined: Jan 30, 2009
Posts: 528
what i mean to ask is that how can a warning can harm an application ??
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 30764
    
156

If you have to ask, it probably isn't needed in your application. Seriously, warnings aren't looked at in most business applications. The first example that comes to mind is an application that troubleshoots database connections.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
RaviNada Kiran
Ranch Hand

Joined: Jan 30, 2009
Posts: 528
Thanks Jaenne , but what do you mean by this ?"The first example that comes to mind is an application that troubleshoots database connections"
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 30764
    
156

Suppose you had a problem and wanted to know everything that the connection could tell you. A SQLWarning could be useful there.

Like I said, I've never needed one in practice.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: About SQLWarning