Win a copy of Java 9 Modularity: Patterns and Practices for Developing Maintainable Applications this week in the Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Database  RSS feed

 
yugandhar channagiri
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i am retriving the values from text boxes s1,s2,s3
using this i want write a query
"SELECT * FROM regis where Username like '%"+s1+"%' and Lastname like '%"+s2+"%' and sex like '%"+s3+"%' "
but here good thing is it is executing
and bad thing is it is not displaying the result
in java
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1) print the statement before executing it
2) run the query in a database client
3) fix the query until it works in the client
4) convert back to your application.

(don't try to debug sql in your code)
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!