0

I'm working on a static method that I want to use to query mysql; I'd like the option of handing a char in but I'm only seeing string or int, what if I want to use a wildcard? '_' or an int '1', anyone have a clever solution?

2
Contributors
3
Replies
5
Views
4 Years
Discussion Span
Last Post by Taywin
0

Not sure what you mean. Please elaborate what you want to do? Give a sample code or input/output would be better.

0

Sorry; in a PreparedStatement pstmt.setChar() or setString(). I was hoping to be able to pass either an int OR and wildcard _ or %.; I ended up using an overloaded method and determined the required method prior to calling it.

0

Oh I see. If you want to add that functionality which PreparedStatement doesn't have, you could extend the class and add that functionality to your new class. I don't think it is a standard way because allowing wild card could cause security problems (more flexibilily with less secure). If you don't understand that, you may go to most websites that allow you to search the site, enter a search with wild card character, and you will see what I mean. Many web developers don't handle wild card character very well.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.