Results 1 to 3 of 3
- 05-25-2011, 05:23 AM #1
Member
- Join Date
- May 2011
- Posts
- 1
- Rep Power
- 0
Can't seem to get a count(*) where query working
I'm kind of new to this and I'm trying to check the existence of a record in my database using count(*).
In MySQL the query is simply SELECT COUNT(*) FROM user WHERE username = 'name'; where 'name' is a variable set by the user's input, I just can't seem to find out how to get the result of the query stored in an integer variable. If anyone could help that would be great.
- 05-25-2011, 09:17 PM #2
Senior Member
- Join Date
- Jun 2008
- Posts
- 2,366
- Rep Power
- 7
uhm int whatever = resultset.getInt(1), maybe?
See the JDBC tutorials.
- 05-27-2011, 09:55 PM #3
Member
- Join Date
- Mar 2010
- Posts
- 12
- Rep Power
- 0
Similar Threads
-
Count down
By tj_wolf2 in forum New To JavaReplies: 8Last Post: 03-14-2011, 05:07 PM -
\n not working in GUI (working code, but \n isn't working)
By cc11rocks in forum New To JavaReplies: 2Last Post: 01-04-2011, 04:30 AM -
to get count value as a variable
By arunkumarinfo in forum JDBCReplies: 2Last Post: 03-30-2009, 01:32 AM -
Java mail problem(working in intranet,but not working in iternet)
By sundarjothi in forum Advanced JavaReplies: 8Last Post: 05-28-2008, 07:00 AM -
Getting row count
By Java Tip in forum Java TipReplies: 0Last Post: 02-11-2008, 08:49 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks