1

I have had quite some difficulty trying to make a User Defined Function (UDF) in Java for my MySQL Server. I was hoping I could ask for some help on this subject.

Here is what I have done so far:

I have followed the instructions on a Planet MySQL post but I fear that it may be outdated, as the plugin files do not contain a psm_java.so file which was expected to exist in the tutorial.

I need to implement the Levenshtein distance in Java given two strings so that I can return that value back. I know how to do that part, but I have not been able to do the SQL interaction part.

Any help is MUCH appreciated.

System information:

Mac OS X 10.7.2 MySQL 5.5.16

5
  • If it matters...I did this about 2 years ago (I used a C udf) and found it wasn't that fast. I then tried Approximate String Joins, and they weren't that fast either. For me, pulling the result set into the JEE container and doing the Levenshtein there was faster. Commented Nov 1, 2011 at 4:55
  • Unfortunately, this is a project assignment that requires me to process the data in this fashion. Commented Nov 1, 2011 at 5:17
  • How would I go about doing it in C? I am on my mac, and all the tutorials seem to point to Visual C++ as being necessary in order to proceed. Commented Nov 1, 2011 at 5:18
  • Do you have to use Levenshtein or will Jaro Winkler (btw.. I think Jaro is better) work? Commented Nov 1, 2011 at 14:05
  • Unfortunately, the requirements are to compute the Levenshtein distance, and only that. Commented Nov 1, 2011 at 19:24

1 Answer 1

1

Why go outside the RDBMS? You can implement the Levenshtein distance in a MySQL UDF pretty easily.

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks for this! My requirements are to do it in C or C++, but I appreciate this.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.