File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes Searching SQL Databases Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Searching SQL Databases" Watch "Searching SQL Databases" New topic
Author

Searching SQL Databases

Heidi Atwood
Greenhorn

Joined: Oct 25, 2012
Posts: 17
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

Joined: Oct 25, 2012
Posts: 17
Never mind - figured it out!!
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 39436
    
  28
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

Joined: Oct 25, 2012
Posts: 17
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

Joined: Oct 25, 2012
Posts: 17
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.


 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Searching SQL Databases