Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 12.0.0 » SQL Anywhere Server - Programming » Java in the database » Java in the database Q & A

 

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.

For more information, see CREATE PROCEDURE statement (external procedures).