aspose file tools*
The moose likes JDBC and the fly likes trouble using string in query (Java & MS Access) 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 "trouble using string in query (Java & MS Access)" Watch "trouble using string in query (Java & MS Access)" New topic
Author

trouble using string in query (Java & MS Access)

Brendan Cregan
Ranch Hand

Joined: Nov 11, 2011
Posts: 35
Hi All,


I have made a quiz servlet program and here I am trying to check if a user is there, then check their previous score, the else statement is working to create a new user in the DB if no score is present.
I'm convinced it has something to do with my syntax, but can't figure out what it is, as I have similar Queries at other sections of my servlet that are working fine.



Thanks for any help,

Brendan
Fatih Keles
Ranch Hand

Joined: Sep 01, 2005
Posts: 182
Hi Brendan,

Can you please use proper setXXX methods for sql statements? It is not that hard and saves a lot of time when passing values to queries Here you can start.

Regards,
Fatih.
Wendy Gibbons
Bartender

Joined: Oct 21, 2008
Posts: 1107

Brendan Cregan wrote:Hi All,


I have made a quiz servlet program and here I am trying to check if a user is there, then check their previous score, the else statement is working to create a new user in the DB if no score is present.
I'm convinced it has something to do with my syntax, but can't figure out what it is, as I have similar Queries at other sections of my servlet that are working fine.

Thanks for any help,

Brendan


what happens if the user exists but doesn't have a previous score.
But as you haven't told us what the actual problem is, I am just guessing.

[wg] edited to move my questions outside the quote.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: trouble using string in query (Java & MS Access)