mysql - Which has better performance, Java or DB functions? -


i'm writing web app , don't know technique faster: implement code using java native or database functions (mysql or maridb in case).

i.e: using java:

string new_string = my_string.replace('-',''); query query = "select * my_table id=" + new_string; 

i.e: using database functions:

query query = "select * my_table id=replace(" + new_string + ",'-',''); 

thanks!

ps: please, forget bad code, know it. it's explain idea :-)

the performance difference going negligible or there more no difference @ all. replacement in java sql logs cleaner if ever want @ them debug / see what's been happening. it's easier search/read through replaced strings think.


Comments

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -