• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to search from multiple column in mysql databse with java?  RSS feed

 
Skm Liyanage
Greenhorn
Posts: 23
Eclipse IDE Java Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I hava follwing method for search.



No error in this code. but, work only catch block every time. So i cannot imagine what i should do for this. please tell How can i search them or what is the above error.? thank you.
 
Rob Spoor
Sheriff
Posts: 20943
81
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Step 1: print the exception stack trace (e.printStackTrace()) so you see what the problem really is. Post the results here.

My guess: an invalid SQL statement. Print out the query before executing and you'll see that you have some single quotes too many.
 
K. Tsang
Bartender
Posts: 3639
16
Firefox Browser Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Missing the % in telephone number like
 
Skm Liyanage
Greenhorn
Posts: 23
Eclipse IDE Java Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks you very much my senior. very much. problem is solved.
there was a so many single quotes unnecessary.
but
e.printStackTrace() is not accepted.
when put it, a compile error generate as " 'void' type not allowed here".
 
K. Tsang
Bartender
Posts: 3639
16
Firefox Browser Java Mac OS X
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Also your query should only be OR rather than have both AND and OR
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!