question on swings i.e delete button

S

smart

Hello, Good Morning every one i am new to work with swings i am facing
problem with delete button.

In an application i kept a button Delete . For delete button i have
taken ShowConfirmDialog i.e YES_NO_OPTION.

When i press YES it is deleting record which is correct. But when i
press NO button it is deleting record which is not happen. I used for
delete query is like this

[ pstmtdel=con.prepareStatement("delete from ICLASS where
Sno='"Sno"'"); ]

[ pstmtdel.executeUpdate();]

And try with if condition also when i put query in if condition it's
showing an error .

Error is variable pstmtdel might not have been initialized

So, how can solve this one. Help me regarding this topic


Thanks
 
J

Jan Thomä

[ pstmtdel=con.prepareStatement("delete from ICLASS where
Sno='"Sno"'"); ]

[ pstmtdel.executeUpdate();]

And try with if condition also when i put query in if condition it's
showing an error .

Error is variable pstmtdel might not have been initialized


Please provide the full code snippet you are referring to. I see no "if"
condition in the code snippet you provided, therefore it is impossible to
find out what your problem is.

Jan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,020
Latest member
GenesisGai

Latest Threads

Top