Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

NPE on ResultSet executeQuery

 
Jaymark Dacpano
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So I have 2 classes. The first is the MainForm where there is a Register button. If the button is clicked the NewUser class opens. The user then enters a username and a password then clicks Save. The Save button then calls the MainForm method search_for_dupe_user to see ifthe username is already registered or not. If it is, the MainForm shows a dialog box. If not, it adds the user and pass to the database. Problem is I'm getting an error on mt ResultSet query and at the line where i called the search_for_dupe_user method.

MainForm class:



NewUser class:



Full StackTrace:
 
S Majumder
Ranch Hand
Posts: 349
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
One quick question , why you have taken Statement's reference in the line 3155 and how you have created it ?

Satya
 
Jaymark Dacpano
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
S Majumder wrote:One quick question , why you have taken Statement's reference in the line 3155 and how you have created it ?

Satya


I created it in my constructor.
 
Paul Clapham
Sheriff
Posts: 21581
33
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And when you say you "created" it, did you just declare it or did you also assign it a value?

And if you assigned it a value, did the assignment code actually run or was it skipped because an exception was thrown and you ignored that?

(By the way "rs.wasNull()" is not the way to find out whether a query returned zero records.)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic