This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes JDBC and Relational Databases and the fly likes Displaying record not exists Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "Displaying record not exists" Watch "Displaying record not exists" New topic
Author

Displaying record not exists

Farakh khan
Ranch Hand

Joined: Mar 22, 2008
Posts: 833
Hello,

I am trying:
1) to print the cv_id that not exists in the database
2) to delete the cv_id records if exists in db

No. (2) is working but (1) not working




Thanks & best regards>
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 63208
    
  69

Please take the time to choose the correct forum for your posts. This forum is for questions on Servlets. For more information, please read this.

This post has been moved to a more appropriate forum.

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 32481
    
214

That's a lot of nested if statements - you might want to extract some of them into separate methods.

In any case, check your indentations. I think the last else is mismatched. It should go with the first if logically, but in the code it does not.


[OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
Farakh khan
Ranch Hand

Joined: Mar 22, 2008
Posts: 833
Now I consized the code but even not succeeded to run this simple code:


Thanks & best regards
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 32481
    
214




Fixed indentation. You are correct that the else isn't the write spot now. Are you saying you don't get "Hello not working" when no results are returned from the query?
 
Have you checked out Aspose?
 
subject: Displaying record not exists
 
It's not a secret anymore!