• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Searching SQL Databases

 
Heidi Atwood
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm working on code that is for an eBookstore project in my class. I have it set up so the user is asked if they are a registered user. If they answer y (for yes), I want to be able to be able to check their login name against an existing database. I've managed to write to the table and I can read from it, but no idea how to actually search it. I'm going to try and put my code in (yes, it's a dogs breakfast) because I don't have a great grasp on how this process works so please forgive me if it's messed up! :-)

 
Heidi Atwood
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Never mind - figured it out!!
 
Campbell Ritchie
Sheriff
Pie
Posts: 49796
69
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well done
Please tell us what the solution was (or us when we read this is one of our databases fora, because I shall move the discussion thither).
 
Heidi Atwood
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not sure how well I can explain, but I'll try. Let me take another look at the code and get my thoughts together, lol...

Heidi
 
Heidi Atwood
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, I got a little further and then got stuck again. I'm able to write to the data base, and retrieve from it, but I'm stuck on understanding how to compare user input to existing data to confirm someone is a registered user. Let me preface this by saying I'm totally winging it and don't have a good understanding of what's happening. Here's what I've got in the main launcher class which isn't working...



And here is the piece in the other class.



And finally the section for the prepared statement.


 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic