How do I use Java and SQL together?

Java methods are declared as stored procedures, and can then be called just like SQL stored procedures.

You must create a stored procedure that runs your method. For example:

CREATE PROCEDURE javaproc() 
EXTERNAL NAME 'JDBCExample.MyMethod()V' 
LANGUAGE JAVA;

You can use many of the classes that are part of the Java API as included in the Sun Microsystems Java Development Kit. You can also use classes created and compiled by Java developers.

 See also