• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
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
Pie
Posts: 20744
68
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: 3583
16
Android Java
  • 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: 3583
16
Android Java
  • 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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic