Java, Software Development

Using @Query to execute a MySQL function

Using @Query to execute a MySQL function as follows. Here is an example that uses Spring Data @Query to execute a MySQL function that returns a string value. Let’s say we have a MySQL function that returns a predefined text.

MySQL Function

hello_world() returns ‘Hello World’ in German.

Using @Query

Using Spring Data, we can use @Query with nativeQuery = true.

Loading

Got comments or suggestions? We disabled the comments on this site to fight off spammers, but you can still contact us via our Facebook page!.


You Might Also Like