Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

About SQLWarning

 
RaviNada Kiran
Ranch Hand
Posts: 528
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
SQLWarning warning = stmt.getWarnings();

Do we ever need to deal with the warnings associated on the Connection , Statement??
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, if they are important to your application.
 
RaviNada Kiran
Ranch Hand
Posts: 528
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 528
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what i mean to ask is that how can a warning can harm an application ??
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34681
367
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
RaviNada Kiran
Ranch Hand
Posts: 528
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 34681
367
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic