[wsf-c-dev] Embedding Axis2 to MySQL
Milinda Lakmal
milinda at wso2.com
Wed Jan 10 22:05:04 PST 2007
Hi,
As described in the MySQL documentation under "Extending MySQL"
(http://dev.mysql.com/doc/refman/5.1/en/extending-mysql.html), there are
two ways to ways to add new functions to MySQL:
*
We can add functions through user-define function (UDF) interface.
User defined functions are compiled as object files and then added
to and remove dynamically using CREATE FUNCTION and DROP FUNCTION
statements.
*
Or we can add functions as native (built-in) MySQL functions.
Native functions are compiled into the mysqld server and become
availabl on a permanent basis.
If we write UDFs, we must install object files in addition to the server
itself. If we compile our functions to the server, we don't need to do that.
But in the case of Native functions we modify a source distribution. We
can add UDFs to a binary MySQL distribution. If we use the Native
function method we have to repeat modifications to the source each time
we upgrade the MySQL. We can continue to use previously installed UDFs,
unless you upgrade to a newer version for which the UDF interface changed.
So, I think in our case UDFs are better.
We can't use MySQL plugin API, because current version only support
full-text parser plugins only.
I also looked at the what parthipan has done. He has written a UDF which
is a client for add function in the Calculator service. I think we have
to develop UDFs that support accessing any web service. So when giving a
function to access any web service via MySQL functions, I think we have
to decide parameters given to that function and return value from the
function. Currently MySQL only support function STRING, INTEGER and REAL
functions.
STRING function means, function that return MySQL STRING. (same for
other types)
-------------------------
| SQL Type | C/C++ Type |
-------------------------
| STRING | char * |
| INTEGER | long long |
| REAL | double |
---------------------------
If you have any suggestions regarding embedding Axis2 to MySQL, please
send it to the mailing list.
Thanks
Milinda
More information about the Wsf-c-dev
mailing list