Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

concatenate 2 queries

Status
Not open for further replies.

sensory21

Programmer
Jan 27, 2004
79
GB
Hi,

I've got a first query:
ResultSet r = s.executeQuery ("SELECT COUNT(*) AS rowcount FROM customer");

further down, I'd like to add another part of the query, how do I write this? I've tried that but it doesn't work:
req = r.(" LIMIT page_start, per_page");

Thanks
Vero
 
It doesn't really work like that. A ResultSet is linked to a certain sql query. So what you are saying is "perform a query, but then at some later arbitrary time, perform it again but with another clause".

So if you need to limit a query, then you need to execute that]query :

ResultSet r = s.executeQuery ("SELECT COUNT(*) AS rowcount FROM customer LIMIT 1");
 
Hi,

can someone tell me how to change this:
<a href=\&quot;customer.jsp?nopage=&quot; + i + &quot;\&quot;>&quot; + i + &quot;</a>

to reload the same page?
I've tried target=_self but what to put instead of customer.jsp please?

Cheers
Vero

ps: Thanks Sedj for your reply earlier, finally I've used the PreparedStatement, glad to know how to use it now! x
 
Hi,

Try this.. if you are calling the same page in URL

String uri = request.getRequestURI();

out.println(&quot;<a href=\&quot;&quot;+ uri +&quot;?nopage=&quot; + i + &quot;\&quot;>&quot; + i + &quot;</a>&quot;);

Cheers,
Venu
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top