• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Statement execute method fails

 
Samson Mlati
Ranch Hand
Posts: 41
Hibernate Java Oracle
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys,

I have a problem with the code below. When I trace the execution my code the while loop never executes. Immediately after statement.execute() it jumps to the end of the function. What am i doing wrong? Heres the function. Thanks in advance. I have in bold the last statement executed and the immediately next line.

 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

} catch (SQLException e) {

} catch (NamingException e) {

}

You are throwing away useful information. Print the stack trace and you will get a clue as to what is going wrong.
 
Samson Mlati
Ranch Hand
Posts: 41
Hibernate Java Oracle
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Paul Sturrock wrote:

} catch (SQLException e) {

} catch (NamingException e) {

}

You are throwing away useful information. Print the stack trace and you will get a clue as to what is going wrong.



duuuhh... i should have done that. Thanks a tonne
 
Jan Cumps
Bartender
Posts: 2576
11
C++ Linux Netbeans IDE
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And, what is the result if you try to run the statement "SELECT locationId * FROM locations " in your database's query tool?
 
Samson Mlati
Ranch Hand
Posts: 41
Hibernate Java Oracle
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jan Cumps wrote:And, what is the result if you try to run the statement "SELECT locationId * FROM locations " in your database's query tool?


I had i typo in the code above, the sql statement is wrong and I coulndn't see that cuz I wasnt printing the stack trace
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic