aspose file tools*
The moose likes JDBC 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
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: 740
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: 61657
    
  67

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: 30957
    
158

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.


[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
Farakh khan
Ranch Hand

Joined: Mar 22, 2008
Posts: 740
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: 30957
    
158




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?
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Displaying record not exists