File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

issue with retriving data from database

 
kessy cruz
Greenhorn
Posts: 29
  • 0
  • 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: 20166
24
MySQL Database
  • 0
  • 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
  • 0
  • 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
  • 0
  • 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: 1107
Eclipse IDE Oracle VI Editor
  • 0
  • 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
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic