dcsimg
Handling SQLException
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Sudheer_Kumar
Posted On:   Monday, August 16, 2004 04:14 AM

hi i put a column in a table as unique key. but when iam trying to enter a duplicate value to that column it is throwing SQLException , iam trying to handle this SQLException in Action class, but it is not entering into that block. it is entering into CreateException block. i want to display the message depending upon the ERROR code. iam using stateless session beans and CMPs and SQLserver. for insert Duplicate rows In SQL Server the ERROR code is 119 right can u please solve my problem. thanks in advance sudheer    More>>

hi
i put a column in a table as unique key. but when iam
trying to enter a duplicate value to that column it is throwing
SQLException , iam trying to handle this SQLException in Action class,
but it is not entering into that block. it is entering into CreateException
block. i want to display the message depending upon the ERROR code.
iam using stateless session beans and CMPs and SQLserver.
for insert Duplicate rows In SQL Server the ERROR code is 119 right


can u please solve my problem.


thanks in advance


sudheer

   <<Less

Re: Handling SQLException

Posted By:   Durai_kumar  
Posted On:   Monday, August 16, 2004 11:09 PM

Check whether u were getting SQLException or DuplicateKeyException. I think u would be getting DuplicateKeyException. As CreateException is the super class of DuplicateKeyException, the control goes into the CreateException block.


Can you Verify?


-Durai
About | Sitemap | Contact