Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

issue with retriving data from database

 
kessy cruz
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Goodday, please this is part of my code, i'm having problem retriving data from my database. i have a textfield called editField where you have to input a codeId and click editBtn to retrive the data from the database, edit and click the update button call updateBtn to save back into the database. Thanks

 
Paul Clapham
Sheriff
Pie
Posts: 20764
30
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And would you like to tell us what that problem is?
 
kessy cruz
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It shows: exception in "Thread-3" java.lang.NullPointerException
Com.mysql.jdbc.exception.jdbc.MYSQLSyntaxErrorExceptionHunknown column in where clause
And points τ̅☺ dis if(!data[0].equalsIgnoreCase(code)){
 
R. Jain
Ranch Hand
Posts: 375
1
Java Python Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
kessy cruz wrote:It shows: exception in "Thread-3" java.lang.NullPointerException
Com.mysql.jdbc.exception.jdbc.MYSQLSyntaxErrorExceptionHunknown column in where clause
And points τ̅☺ dis if(!data[0].equalsIgnoreCase(code)){


And would you also like to tell us where is your "data" ?? and Where is your Course Class??
 
Wendy Gibbons
Bartender
Posts: 1110
Eclipse IDE Oracle VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
is codeId a string or integer.
This woukld be a perfect time to rewrite to use prepared statements, here is a page that explains why
use prepared statements
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic